-
Notifications
You must be signed in to change notification settings - Fork 15
48 lines (40 loc) · 1.39 KB
/
devcontainer_build_publish.yml
File metadata and controls
48 lines (40 loc) · 1.39 KB
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
48
name: Build and Publish Dev Container
on:
workflow_dispatch: # Manually trigger a workflow run using the GitHub API, GitHub CLI, or the GitHub UI.
push:
branches:
- main
paths:
- .devcontainer/*
- .python-version
- pyproject.toml
schedule:
- cron: '30 15 10 * *'
permissions:
contents: read
packages: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}-dev-container
jobs:
build-and-publish:
if: github.repository == 'UCREL/pymusas'
runs-on: ubuntu-latest
steps:
- name: Lower case image name
run: |
LOWER_IMAGE_NAME=$(echo "${{ env.IMAGE_NAME }}" | tr '[:upper:]' '[:lower:]')
echo "LOWER_IMAGE_NAME=$LOWER_IMAGE_NAME" >> $GITHUB_ENV
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.02
- name: Login to GitHub Container Registry
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pre-build dev container image
uses: devcontainers/ci@b63b30de439b47a52267f241112c5b453b673db5 # v0.3.1900000449
with:
imageName: ${{ env.REGISTRY }}/${{ env.LOWER_IMAGE_NAME }}
cacheFrom: ${{ env.REGISTRY }}/${{ env.LOWER_IMAGE_NAME }}
push: always