Skip to content

Commit

Permalink
feat: update build
Browse files Browse the repository at this point in the history
  • Loading branch information
npv2k1 committed Aug 10, 2024
1 parent c41da8c commit 1c9dfaf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 30 deletions.
44 changes: 17 additions & 27 deletions .github/workflows/build-dev-container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ name: "Build dev container"
on:
push:
branches:
- master
- main
- develop

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
list-dir:
Expand Down Expand Up @@ -50,35 +50,25 @@ jobs:
with:
use: true

# - name: Login to GitHub Container Registry
# uses: docker/login-action@v2
# with:
# registry: ghcr.io
# username: ${{ github.repository_owner }}
# password: ${{ secrets.GITHUB_TOKEN }}

- name: Login to Docker registry
- name: Log in to the Container registry
uses: docker/[email protected]
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and run Dev Container task
uses: devcontainers/[email protected]
with:
subFolder: ./templates/${{ matrix.dir }}
imageName: npv2k1/codespace
cacheFrom: npv2k1/codespace:${{ matrix.dir }}-${{ github.ref == 'refs/heads/master' && 'latest' || github.ref_name }}
imageTag: ${{ matrix.dir }}-${{ github.ref == 'refs/heads/master' && 'latest' || github.ref_name }}
platform: linux/amd64,linux/arm64
imageName: ghcr.io/pnstack/codespace/${{ matrix.dir }}
cacheFrom: ghcr.io/pnstack/codespace/${{ matrix.dir }}:latest
imageTag: ${{ github.ref == 'refs/heads/main' && 'latest' || steps.meta.outputs.tags }}
platform: linux/amd64 #,linux/arm64
push: always

# - name: Build and run Dev Container task
# uses: devcontainers/[email protected]
# with:
# subFolder: ./templates/${{ matrix.dir }}
# imageName: ghcr.io/pnstack/codespace/${{ matrix.dir }}
# cacheFrom: ghcr.io/pnstack/codespace/${{ matrix.dir }}:latest
# imageTag: ${{ github.ref == 'refs/heads/master' && 'latest' || github.ref_name }}
# platform: linux/amd64,linux/arm64
# # push: always
6 changes: 3 additions & 3 deletions .github/workflows/update-documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ name: "Update Documentation"
on:
push:
branches:
- master
- main
workflow_dispatch:

jobs:
generate:
runs-on: ubuntu-latest
environment: documentation
if: "github.ref == 'refs/heads/master'"
if: "github.ref == 'refs/heads/main'"
steps:
- uses: actions/checkout@v3

Expand Down Expand Up @@ -51,4 +51,4 @@ jobs:
-f body="$message" \
-f head="$branch" \
-f base='main'
fi
fi

0 comments on commit 1c9dfaf

Please sign in to comment.