Skip to content

Update github actions ubuntu base image #119

Update github actions ubuntu base image

Update github actions ubuntu base image #119

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "main" ]
tags: [ "v*.*.*" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- name: Build Docker image
uses: docker/build-push-action@v3
with:
tags: acme-redirect
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Test the Docker image
run: docker run --rm acme-redirect --help
- name: Login to github container registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push the image to `edge`
if: github.event_name == 'push' && github.ref_name == 'main'
run: |
docker tag acme-redirect ghcr.io/${{ github.repository }}:edge
docker push ghcr.io/${{ github.repository }}:edge
- name: Push the image to `${{ github.ref_name }}`
if: github.ref_type == 'tag'
run: |
docker tag acme-redirect ghcr.io/${{ github.repository }}:${{ github.ref_name }}
docker push ghcr.io/${{ github.repository }}:${{ github.ref_name }}
- name: Push the image to `latest`
if: github.ref_type == 'tag'
run: |
docker tag acme-redirect ghcr.io/${{ github.repository }}:latest
docker push ghcr.io/${{ github.repository }}:latest