Skip to content

feat: Switch from master to main (#12) #57

feat: Switch from master to main (#12)

feat: Switch from master to main (#12) #57

Workflow file for this run

name: Build
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Prepare
id: prep
run: |
source version
DOCKER_IMAGE=${{ secrets.DOCKERHUB_USERNAME }}/dorker
TAGS="${DOCKER_IMAGE}:${TAG},${DOCKER_IMAGE}:${TAG_OS}"
echo ::set-output name=tags::${TAGS}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Log into registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: Dockerfile
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
push: true
tags: ${{ steps.prep.outputs.tags }}
- name: Build (no push)
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: Dockerfile
platforms: linux/amd64
push: false
tags: ${{ steps.prep.outputs.tags }}