deploy images #96
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: deploy images | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
schedule: | |
- cron: "0 0 * * 1" | |
workflow_dispatch: | |
jobs: | |
clean-untagged: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clean untagged versions | |
uses: duskmoon314/action-delete-ghcr-untagged@v1 | |
with: | |
token: ${{ secrets.PAT }} | |
package_name: dev-env | |
expiration: 7 | |
build-base: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- ubuntu-version: 18.04 | |
tags: base-18 | |
- ubuntu-version: 20.04 | |
tags: base-20 | |
- ubuntu-version: 22.04 | |
tags: base-22 | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
build-args: | | |
BASE_IMG=ubuntu:${{ matrix.ubuntu-version }} | |
file: dockerfiles/base.Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: | | |
duskmoon/dev-env:${{ matrix.tags }} | |
ghcr.io/duskmoon314/dev-env:${{ matrix.tags }} | |
cache-from: type=registry,ref=ghcr.io/duskmoon314/dev-env:${{ matrix.tags }} | |
cache-to: type=inline | |
build-rust: | |
needs: build-base | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- base-img: base-18 | |
tags: rust-18 | |
- base-img: base-20 | |
tags: rust-20 | |
- base-img: base-22 | |
tags: rust-22 | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
build-args: | | |
BASE_IMG=duskmoon/dev-env:${{ matrix.base-img }} | |
file: dockerfiles/apply-rust.Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: | | |
duskmoon/dev-env:${{ matrix.tags }} | |
ghcr.io/duskmoon314/dev-env:${{ matrix.tags }} | |
cache-from: type=registry,ref=ghcr.io/duskmoon314/dev-env:${{ matrix.tags }} | |
cache-to: type=inline | |
build-qemu-dep: | |
needs: build-base | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- base-img: base-18 | |
tags: qemu-dep-18 | |
qemu-version: 5.2.0 | |
- base-img: base-20 | |
tags: qemu-dep-20 | |
qemu-version: 5.2.0 | |
- base-img: base-22 | |
tags: qemu-dep-22 | |
qemu-version: 5.2.0 | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
build-args: | | |
BASE_IMG=duskmoon/dev-env:${{ matrix.base-img }} | |
QEMU_VER=${{ matrix.qemu-version }} | |
file: dockerfiles/apply-qemu-dep.Dockerfile | |
platforms: linux/amd64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: | | |
duskmoon/dev-env:${{ matrix.tags }} | |
ghcr.io/duskmoon314/dev-env:${{ matrix.tags }} | |
cache-from: type=registry,ref=ghcr.io/duskmoon314/dev-env:${{ matrix.tags }} | |
cache-to: type=inline | |
build-qemu-dep-rust: | |
needs: build-qemu-dep | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- base-img: qemu-dep-18 | |
tags: qemu-dep-rust-18 | |
- base-img: qemu-dep-20 | |
tags: qemu-dep-rust-20 | |
- base-img: qemu-dep-22 | |
tags: qemu-dep-rust-22 | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
build-args: | | |
BASE_IMG=duskmoon/dev-env:${{ matrix.base-img }} | |
file: dockerfiles/apply-qemu-dep-rust.Dockerfile | |
platforms: linux/amd64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: | | |
duskmoon/dev-env:${{ matrix.tags }} | |
ghcr.io/duskmoon314/dev-env:${{ matrix.tags }} | |
cache-from: type=registry,ref=ghcr.io/duskmoon314/dev-env:${{ matrix.tags }} | |
cache-to: type=inline | |
build-qemu: | |
needs: build-base | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- base-img: base-18 | |
tags: qemu7-18 | |
qemu-version: 7.0.0 | |
- base-img: base-20 | |
tags: qemu7-20 | |
qemu-version: 7.0.0 | |
- base-img: base-22 | |
tags: qemu7-22 | |
qemu-version: 7.0.0 | |
- base-img: base-18 | |
tags: qemu6-18 | |
qemu-version: 6.2.0 | |
- base-img: base-20 | |
tags: qemu6-20 | |
qemu-version: 6.2.0 | |
- base-img: base-22 | |
tags: qemu6-22 | |
qemu-version: 6.2.0 | |
- base-img: base-18 | |
tags: qemu5-18 | |
qemu-version: 5.2.0 | |
- base-img: base-20 | |
tags: qemu5-20 | |
qemu-version: 5.2.0 | |
- base-img: base-22 | |
tags: qemu5-22 | |
qemu-version: 5.2.0 | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
build-args: | | |
BASE_IMG=duskmoon/dev-env:${{ matrix.base-img }} | |
QEMU_VER=${{ matrix.qemu-version }} | |
file: dockerfiles/apply-qemu.Dockerfile | |
platforms: linux/amd64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: | | |
duskmoon/dev-env:${{ matrix.tags }} | |
ghcr.io/duskmoon314/dev-env:${{ matrix.tags }} | |
cache-from: type=registry,ref=ghcr.io/duskmoon314/dev-env:${{ matrix.tags }} | |
cache-to: type=inline | |
build-qemu-rust: | |
needs: build-qemu | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- base-img: qemu7-18 | |
tags: qemu7-rust-18 | |
- base-img: qemu7-20 | |
tags: qemu7-rust-20 | |
- base-img: qemu7-22 | |
tags: qemu7-rust-22 | |
- base-img: qemu6-18 | |
tags: qemu6-rust-18 | |
- base-img: qemu6-20 | |
tags: qemu6-rust-20 | |
- base-img: qemu6-22 | |
tags: qemu6-rust-22 | |
- base-img: qemu5-18 | |
tags: qemu5-rust-18 | |
- base-img: qemu5-20 | |
tags: qemu5-rust-20 | |
- base-img: qemu5-22 | |
tags: qemu5-rust-22 | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
build-args: | | |
BASE_IMG=duskmoon/dev-env:${{ matrix.base-img }} | |
file: dockerfiles/apply-qemu-rust.Dockerfile | |
platforms: linux/amd64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: | | |
duskmoon/dev-env:${{ matrix.tags }} | |
ghcr.io/duskmoon314/dev-env:${{ matrix.tags }} | |
cache-from: type=registry,ref=ghcr.io/duskmoon314/dev-env:${{ matrix.tags }} | |
cache-to: type=inline | |
build-go: | |
needs: build-base | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- base-img: base-18 | |
tags: go-18 | |
- base-img: base-20 | |
tags: go-20 | |
- base-img: base-22 | |
tags: go-22 | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
build-args: | | |
BASE_IMG=duskmoon/dev-env:${{ matrix.base-img }} | |
file: dockerfiles/apply-go.Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: | | |
duskmoon/dev-env:${{ matrix.tags }} | |
ghcr.io/duskmoon314/dev-env:${{ matrix.tags }} | |
cache-from: type=registry,ref=ghcr.io/duskmoon314/dev-env:${{ matrix.tags }} | |
cache-to: type=inline | |
build-go-rust: | |
needs: build-base | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- base-img: base-18 | |
tags: go-rust-18 | |
- base-img: base-20 | |
tags: go-rust-20 | |
- base-img: base-22 | |
tags: go-rust-22 | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
build-args: | | |
BASE_IMG=duskmoon/dev-env:${{ matrix.base-img }} | |
file: dockerfiles/apply-go-rust.Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: | | |
duskmoon/dev-env:${{ matrix.tags }} | |
ghcr.io/duskmoon314/dev-env:${{ matrix.tags }} | |
cache-from: type=registry,ref=ghcr.io/duskmoon314/dev-env:${{ matrix.tags }} | |
cache-to: type=inline | |
build-tina: | |
needs: build-base | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- base-img: base-20 | |
tags: tina-20 | |
- base-img: base-22 | |
tags: tina-22 | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
build-args: | | |
BASE_IMG=duskmoon/dev-env:${{ matrix.base-img }} | |
file: dockerfiles/apply-tina.Dockerfile | |
platforms: linux/amd64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: | | |
duskmoon/dev-env:${{ matrix.tags }} | |
ghcr.io/duskmoon314/dev-env:${{ matrix.tags }} | |
cache-from: type=registry,ref=ghcr.io/duskmoon314/dev-env:${{ matrix.tags }} | |
cache-to: type=inline | |
build-rcore-ci: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- ubuntu-version: 20.04 | |
tags: rcore-ci | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
build-args: | | |
BASE_IMG=ubuntu:${{ matrix.ubuntu-version }} | |
file: dockerfiles/rcore-ci.Dockerfile | |
platforms: linux/amd64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: | | |
duskmoon/dev-env:${{ matrix.tags }} | |
ghcr.io/duskmoon314/dev-env:${{ matrix.tags }} | |
cache-from: type=registry,ref=ghcr.io/duskmoon314/dev-env:${{ matrix.tags }} | |
cache-to: type=inline | |
build-ucore-ci: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- ubuntu-version: 20.04 | |
tags: ucore-ci | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
build-args: | | |
BASE_IMG=ubuntu:${{ matrix.ubuntu-version }} | |
file: dockerfiles/ucore-ci.Dockerfile | |
platforms: linux/amd64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: | | |
duskmoon/dev-env:${{ matrix.tags }} | |
ghcr.io/duskmoon314/dev-env:${{ matrix.tags }} | |
cache-from: type=registry,ref=ghcr.io/duskmoon314/dev-env:${{ matrix.tags }} | |
cache-to: type=inline |