Dev container #8
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: Set up Depot CLI | |
# uses: depot/setup-action@v1 | |
# with: | |
# oidc: true | |
# | |
# - name: Setup Docker to use Depot | |
# run: depot configure-docker | |
- name: Login to GHCR | |
uses: docker/#-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 }}/uyuni-tools-devcontainer:${{ steps.meta.outputs.tag }} \ | |
--image-name ghcr.io/${{ github.repository }}/uyuni-tools-devcontainer:latest \ | |
--push | |
env: | |
BUILDX_NO_DEFAULT_ATTESTATIONS: true |