Skip to content

Merge branch 'timvisee:master' into master #5

Merge branch 'timvisee:master' into master

Merge branch 'timvisee:master' into master #5

Workflow file for this run

name: Publish Docker Image
on:
push:
branches:
- master
tags:
- '*'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Set up docker buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
version: latest
- name: Login to Github Package
uses: docker/login-action@v1
with:
registry: ghcr.io
username: sum-build
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build master branch and push
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: 'ghcr.io/sum-build/send:latest'
- name: Get all docker tags
if: startsWith(github.ref, 'refs/tags/')
uses: actions/github-script@v6
id: tags
with:
script: |
const ref = context.payload.ref.replace(/\/?refs\/tags\//, '')
const tags = [
'ghcr.io/sum-build/send:latest',
`ghcr.io/sum-build/send:${ref}`
]
return tags.join(',')
result-encoding: string
- name: Build release and push
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{steps.tags.outputs.result}}