Skip to content

Commit

Permalink
workflow: push docker image to ghcr.io
Browse files Browse the repository at this point in the history
  • Loading branch information
tsl0922 committed Nov 26, 2024
1 parent b1eaaee commit 4dad131
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
jobs:
build:
runs-on: ubuntu-22.04
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Install packages
Expand All @@ -28,6 +31,11 @@ jobs:
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Determine docker tags
id: docker_tag
run: |
Expand All @@ -42,18 +50,22 @@ jobs:
echo "ALPINE_TAG=tsl0922/ttyd:alpine" >> $GITHUB_ENV
esac
- name: build/push docker image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/s390x
push: true
tags: ${{ env.DOCKER_TAG }}
tags: |
${{ env.DOCKER_TAG }}
ghcr.io/${{ env.DOCKER_TAG }}
- name: build/push docker image (alpine)
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile.alpine
platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/s390x
push: true
tags: ${{ env.ALPINE_TAG }}
tags: |
${{ env.ALPINE_TAG }}
ghcr.io/${{ env.ALPINE_TAG }}

0 comments on commit 4dad131

Please sign in to comment.