Skip to content

Commit

Permalink
ci: 🎡 add GHCR deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
abcfy2 committed Jul 9, 2024
1 parent 679d974 commit 48b9d4a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/docker_build_alpine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@ on:

env:
DOCKER_REPOSITORY: abcfy2/zhparser
GHCR_REPOSITORY: ghcr.io/${{ github.repository }}

jobs:
docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -63,14 +69,14 @@ jobs:
PG_TAG: ${{ matrix.pg_tag }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
push: ${{ env.PUSH }}
pull: true
file: Dockerfile.alpine
build-args: |
PG_TAG=${{ matrix.pg_tag }}
platforms: ${{ env.PLATFORMS }}
tags: ${{ env.DOCKER_REPOSITORY }}:${{ matrix.pg_tag }}
tags: ${{ env.DOCKER_REPOSITORY }}:${{ matrix.pg_tag }},${{ env.GHCR_REPOSITORY }}:${{ matrix.pg_tag }}
cache-from: type=gha
cache-to: type=gha,mode=max
10 changes: 8 additions & 2 deletions .github/workflows/docker_build_debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@ on:

env:
DOCKER_REPOSITORY: abcfy2/zhparser
GHCR_REPOSITORY: ghcr.io/${{ github.repository }}

jobs:
docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -63,14 +69,14 @@ jobs:
PG_TAG: ${{ matrix.pg_tag }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
push: ${{ env.PUSH }}
pull: true
file: Dockerfile.debian
build-args: |
PG_TAG=${{ matrix.pg_tag }}
platforms: ${{ env.PLATFORMS }}
tags: ${{ env.DOCKER_REPOSITORY }}:${{ matrix.pg_tag }}
tags: ${{ env.DOCKER_REPOSITORY }}:${{ matrix.pg_tag }},${{ env.GHCR_REPOSITORY }}:${{ matrix.pg_tag }}
cache-from: type=gha
cache-to: type=gha,mode=max
2 changes: 1 addition & 1 deletion .github/workflows/docker_hub_description.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v3
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
Expand Down

0 comments on commit 48b9d4a

Please sign in to comment.