Skip to content

Build

Build #378

Workflow file for this run

name: Build
on:
schedule:
- cron: "0 6 * * *"
push:
jobs:
build:
strategy:
matrix:
os:
[
{ version: 20.04, code: focal, latest: false },
{ version: 22.04, code: jammy, latest: true },
]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set Current Date
env:
TZ: 'Asia/Tokyo'
run: echo "CURRENT_DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push
if: ${{ matrix.os.latest == false }}
uses: docker/build-push-action@v3
with:
build-args: TARGET_TAG=${{ matrix.os.code }}
context: .
platforms: linux/amd64, linux/arm64
push: true
tags: |
atsushisaito/docker-ubuntu-sweb:${{ matrix.os.code }}
atsushisaito/docker-ubuntu-sweb:${{ matrix.os.code }}-${{ env.CURRENT_DATE }}
atsushisaito/docker-ubuntu-sweb:${{ matrix.os.version }}
- name: Build and Push Latest
if: ${{ matrix.os.latest == true }}
uses: docker/build-push-action@v3
with:
build-args: TARGET_TAG=${{ matrix.os.code }}
context: .
platforms: linux/amd64, linux/arm64
push: true
tags: |
atsushisaito/docker-ubuntu-sweb:${{ matrix.os.code }}
atsushisaito/docker-ubuntu-sweb:${{ matrix.os.code }}-${{ env.CURRENT_DATE }}
atsushisaito/docker-ubuntu-sweb:${{ matrix.os.version }}
atsushisaito/docker-ubuntu-sweb:latest