update main to master in workflow #2
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: Create docker container on push to main | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
tags: | |
- 'v*.*.*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: arm64 | |
- uses: docker/setup-buildx-action@v2 | |
- name: Setup SSH agent | |
run: | | |
eval `ssh-agent` | |
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> "$GITHUB_ENV" | |
- name: Login to Github Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract Docker metadata | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: ghcr.io/tiiuae/adb-docker | |
tags: | | |
type=ref,event=branch | |
type=semver,pattern={{version}} | |
type=sha | |
type=raw,value=latest | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
platforms: linux/arm64 | |
push: ${{ github.event_name != 'pull_request' }} | |
ssh: default=${{ env.SSH_AUTH_SOCK }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |