1
0
Fork 0

Switch to `GITHUB_TOKEN`

main
Ambrose Chua 2021-11-16 12:21:31 +08:00 committed by GitHub
parent e8236d3189
commit 1d382855cf
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/datetime.link:latest
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
deploy:
name: Deploy to pricklypear