Build Dev Container #27
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
# This workflow builds and pushes a new version of the Dev Container | |
# image to GitHub Packages every day at 1am UTC. | |
# It ensures that the dev container image is constantly updated and the cache is always fresh. | |
name: Build Dev Container | |
on: | |
schedule: | |
- cron: "0 1 * * *" # Every day at 1am UTC | |
jobs: | |
build: | |
name: Build Dev Container | |
runs-on: ubuntu-latest | |
if: github.repository == 'connery-io/connery' && github.ref == 'refs/heads/main' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to GitHub Packages | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./.devcontainer/Dockerfile | |
push: true | |
tags: ghcr.io/${{ github.repository }}/dev-container:latest | |
cache-from: type=gha,scope=${{ github.repository }} | |
cache-to: type=gha,scope=${{ github.repository }},mode=max | |
platforms: linux/amd64,linux/arm64 |