Ubuntu Focal #30
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: Ubuntu Focal | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '15 21 * * 2' | |
push: | |
branches: [ "main" ] | |
paths: | |
- "ubuntu-focal/**" | |
pull_request: | |
branches: [ "main" ] | |
paths: | |
- "ubuntu-focal/**" | |
env: | |
# The default repo env will be 'ComputeStacks'; uppercase is not allowed. | |
GH_REPO: computestacks/cs-docker-base | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log into Github Registry | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Log into DockerHub | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
id: build-and-push | |
uses: docker/build-push-action@v3 | |
with: | |
context: ubuntu-focal/ | |
platforms: linux/amd64,linux/arm64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: | | |
cmptstks/baseimage:ubuntu-focal | |
cmptstks/baseimage:ubuntu | |
ghcr.io/${{ env.GH_REPO }}:ubuntu-focal | |
ghcr.io/${{ env.GH_REPO }}:ubuntu | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |