publish dockers #16
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: publish dockers | |
on: | |
create: | |
tags: | |
- 'v*' | |
branches-ignore: | |
- '*' | |
jobs: | |
release-github: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- | |
uses: actions/checkout@v4 | |
- | |
name: Build image | |
run: docker build . --file Dockerfile --tag turn-server --label "runnumber=${GITHUB_RUN_ID}" | |
- | |
name: Log in to registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | |
- | |
name: Push image | |
run: | | |
IMAGE_ID=$(echo "ghcr.io/${{ github.repository_owner }}/turn-server" | tr '[A-Z]' '[a-z]') | |
docker tag turn-server $IMAGE_ID:${{github.ref_name}} | |
docker push $IMAGE_ID:${{github.ref_name}} | |
docker tag turn-server $IMAGE_ID:latest | |
docker push $IMAGE_ID:latest | |
release-dockerhub: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Login to GithubPackages | |
uses: docker/login-action@v2 | |
with: | |
username: '${{ secrets.DOCKERHUB_USERNAME }}' | |
password: '${{ secrets.DOCKERHUB_TOKEN }}' | |
- | |
name: build and push docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
platforms: linux/amd64 | |
push: true | |
file: Dockerfile | |
cache-from: type=gha | |
cache-to: 'type=gha,mode=max' | |
tags: quasipaa/turn-server:${{github.ref_name}}, quasipaa/turn-server:latest |