1
0
Fork 0

Switch to `GITHUB_TOKEN`

pull/12/head v0.1.0
Ambrose Chua 2021-11-16 12:53:32 +08:00 committed by GitHub
parent 3c8bb3fc01
commit 7ab6b96b3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 6 deletions

View File

@ -2,8 +2,13 @@ name: Deploy
on:
push:
tags: ["v*"]
branches: [ main ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
publish:
@ -21,19 +26,26 @@ jobs:
uses: docker/setup-buildx-action@v1
- name: Docker Login
uses: docker/login-action@v1.6.0
uses: docker/login-action@v1
with:
registry: ghcr.io
username: $GITHUB_ACTOR
password: ${{ secrets.CR_PAT }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate Docker tags
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
id: meta
- name: Build and push Docker images
uses: docker/build-push-action@v2.1.0
uses: docker/build-push-action@v2
with:
pull: true
platforms: linux/amd64
push: true
tags: ghcr.io/serverwentdown/upl:latest
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# vim: set et ts=2 sw=2: