-
Notifications
You must be signed in to change notification settings - Fork 19
45 lines (40 loc) · 1.17 KB
/
prebuilt_devcontainer.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
# SPDX-FileCopyrightText: 2023 SUSE LLC
#
# SPDX-License-Identifier: Apache-2.0
name: 'pre-built devcontainer'
on:
push:
branches:
- main
jobs:
devcontainer-build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
packages: write
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
- name: Compute tag for devcontainer image
id: meta
run: |
tag=$(git rev-parse --short HEAD)
echo "tag=$tag" >> "$GITHUB_OUTPUT"
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and release devcontainer
run: |
npm install -g @devcontainers/cli
devcontainer build \
--workspace-folder . \
--image-name ghcr.io/${{ github.repository }}/devcontainer:${{ steps.meta.outputs.tag }} \
--image-name ghcr.io/${{ github.repository }}/devcontainer:latest \
--push
env:
BUILDX_NO_DEFAULT_ATTESTATIONS: true