Dev container #26
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
# SPDX-FileCopyrightText: 2023 SUSE LLC | |
# | |
# SPDX-License-Identifier: Apache-2.0 | |
name: 'pre-built devcontainer' | |
on: # rebuild any PRs and main branch changes | |
pull_request: | |
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 |