-
Notifications
You must be signed in to change notification settings - Fork 204
47 lines (40 loc) · 1.59 KB
/
build-devcontainer-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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/**
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
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pinned to 4.1.7
- name: Log in to GitHub Docker Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # pinned to v3.3.0
with:
registry: docker.pkg.github.com # ghcr.io not yet enabled for Azure org
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build & push Devcontainer image
uses: docker/build-push-action@v4
with:
context: .devcontainer
push: true
# Build an image usable as cache-from, per: https://docs.docker.com/engine/reference/commandline/build/#specifying-external-cache-sources
build-args: BUILDKIT_INLINE_CACHE=1
tags: |
docker.pkg.github.com/azure/azure-service-operator/aso-devcontainer:latest
docker.pkg.github.com/azure/azure-service-operator/aso-devcontainer:${{ github.sha }}