mirror of
https://github.com/tsl0922/ttyd.git
synced 2025-12-18 01:54:20 +01:00
workflow: push docker image to ghcr.io
This commit is contained in:
20
.github/workflows/docker.yml
vendored
20
.github/workflows/docker.yml
vendored
@@ -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
|
||||
@@ -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: |
|
||||
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user