Skip to content

.github/workflows/devcontainer-ci.yml #30

.github/workflows/devcontainer-ci.yml

.github/workflows/devcontainer-ci.yml #30

name: devcontainer-ci
on:
schedule:
- cron: "0 10 * * *" # everyday at 10am
push:
branches:
- "main"
tags:
- "v*"
pull_request:
branches:
- "main"
jobs:
docker:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Log in to the GitHub Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU for multiarch builds
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx for multiarch builds
uses: docker/setup-buildx-action@v3
- name: Extract metadata (tags, labels) for Docker image
id: meta
uses: docker/metadata-action@v5
with:
images: |
usethefork/snowblower
ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}
type=edge,branch=main
- name: Build and push docker image to dockerhub
uses: docker/build-push-action@v5
with:
context: "./packages/dev_container"
file: ./packages/dev_container/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}