Skip to content

Bump golang (#8)

Bump golang (#8) #5

Workflow file for this run

name: publish-main
on:
push:
branches:
- main
jobs:
publish-docker-image:
runs-on: ubuntu-latest
env:
IMAGE_NAME: ghcr.io/thorsager/surl
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Prepare
id: prep
run: |
echo "tags=${IMAGE_NAME}:latest" >> $GITHUB_OUTPUT
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build
uses: docker/build-push-action@v3
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64/v8,linux/arm/v6,linux/arm/v7
push: true
tags: ${{ steps.prep.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache