Skip to content

Build Devcontainer image #385

Build Devcontainer image

Build Devcontainer image #385

name: Build Devcontainer image
on:
workflow_dispatch:
# no content, allows manual triggering
schedule:
# 5:30 pm every Sunday (UTC)
# to pick up any important bug fixes etc in base image
- cron: '30 17 * * 0'
push:
# run when changes pushed to main branch if any devcontainer files changed
branches:
- main
paths:
- .devcontainer/**
permissions: {}
jobs:
# Based on: https://docs.github.com/en/actions/guides/publishing-docker-images#publishing-images-to-github-packages
build-devcontainer-image:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
# Only run this scheduled job on the main repo, it can't work elsewhere
if: ${{ github.repository == 'Azure/azure-service-operator' }}
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # pinned to 7.0.1
- name: Log in to GitHub Docker Registry
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # pinned to v4.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build & push Devcontainer image
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # pinned to v7.3.0
with:
context: .
file: .devcontainer/Dockerfile
push: true
# Embed inline cache metadata so consumers can use --cache-from
cache-to: type=inline
tags: |
ghcr.io/azure/azure-service-operator/aso-devcontainer:latest
ghcr.io/azure/azure-service-operator/aso-devcontainer:${{ github.sha }}