Skip to content

Commit 1c9dfaf

Browse files
committed
feat: update build
1 parent c41da8c commit 1c9dfaf

File tree

2 files changed

+20
-30
lines changed

2 files changed

+20
-30
lines changed

.github/workflows/build-dev-container.yaml

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ name: "Build dev container"
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
- develop
88

99
concurrency:
1010
group: ${{ github.workflow }}-${{ github.ref }}
1111
cancel-in-progress: true
1212

1313
env:
14-
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
15-
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
14+
REGISTRY: ghcr.io
15+
IMAGE_NAME: ${{ github.repository }}
1616

1717
jobs:
1818
list-dir:
@@ -50,35 +50,25 @@ jobs:
5050
with:
5151
use: true
5252

53-
# - name: Login to GitHub Container Registry
54-
# uses: docker/login-action@v2
55-
# with:
56-
# registry: ghcr.io
57-
# username: ${{ github.repository_owner }}
58-
# password: ${{ secrets.GITHUB_TOKEN }}
59-
60-
- name: Login to Docker registry
53+
- name: Log in to the Container registry
6154
uses: docker/[email protected]
6255
with:
63-
username: ${{ env.DOCKER_USERNAME }}
64-
password: ${{ env.DOCKER_PASSWORD }}
56+
registry: ${{ env.REGISTRY }}
57+
username: ${{ github.actor }}
58+
password: ${{ secrets.GITHUB_TOKEN }}
59+
60+
- name: Extract metadata (tags, labels) for Docker
61+
id: meta
62+
uses: docker/metadata-action@v5
63+
with:
64+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
6565

6666
- name: Build and run Dev Container task
6767
uses: devcontainers/[email protected]
6868
with:
6969
subFolder: ./templates/${{ matrix.dir }}
70-
imageName: npv2k1/codespace
71-
cacheFrom: npv2k1/codespace:${{ matrix.dir }}-${{ github.ref == 'refs/heads/master' && 'latest' || github.ref_name }}
72-
imageTag: ${{ matrix.dir }}-${{ github.ref == 'refs/heads/master' && 'latest' || github.ref_name }}
73-
platform: linux/amd64,linux/arm64
70+
imageName: ghcr.io/pnstack/codespace/${{ matrix.dir }}
71+
cacheFrom: ghcr.io/pnstack/codespace/${{ matrix.dir }}:latest
72+
imageTag: ${{ github.ref == 'refs/heads/main' && 'latest' || steps.meta.outputs.tags }}
73+
platform: linux/amd64 #,linux/arm64
7474
push: always
75-
76-
# - name: Build and run Dev Container task
77-
# uses: devcontainers/[email protected]
78-
# with:
79-
# subFolder: ./templates/${{ matrix.dir }}
80-
# imageName: ghcr.io/pnstack/codespace/${{ matrix.dir }}
81-
# cacheFrom: ghcr.io/pnstack/codespace/${{ matrix.dir }}:latest
82-
# imageTag: ${{ github.ref == 'refs/heads/master' && 'latest' || github.ref_name }}
83-
# platform: linux/amd64,linux/arm64
84-
# # push: always

.github/workflows/update-documentation.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ name: "Update Documentation"
22
on:
33
push:
44
branches:
5-
- master
5+
- main
66
workflow_dispatch:
77

88
jobs:
99
generate:
1010
runs-on: ubuntu-latest
1111
environment: documentation
12-
if: "github.ref == 'refs/heads/master'"
12+
if: "github.ref == 'refs/heads/main'"
1313
steps:
1414
- uses: actions/checkout@v3
1515

@@ -51,4 +51,4 @@ jobs:
5151
-f body="$message" \
5252
-f head="$branch" \
5353
-f base='main'
54-
fi
54+
fi

0 commit comments

Comments
 (0)