Skip to content

Commit 641986b

Browse files
committed
Update build-dev-container.yaml to enable Docker registry login and use environment variables for credentials
1 parent 26adf12 commit 641986b

File tree

1 file changed

+29
-8
lines changed

1 file changed

+29
-8
lines changed

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

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
- master
77
- develop
88

9+
env:
10+
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
11+
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
12+
913
jobs:
1014
list-dir:
1115
runs-on: ubuntu-latest
@@ -39,21 +43,38 @@ jobs:
3943

4044
- name: Set up Docker Buildx
4145
uses: docker/setup-buildx-action@v3
46+
with:
47+
use: true
4248

43-
- name: Login to GitHub Container Registry
44-
uses: docker/login-action@v2
49+
# - name: Login to GitHub Container Registry
50+
# uses: docker/login-action@v2
51+
# with:
52+
# registry: ghcr.io
53+
# username: ${{ github.repository_owner }}
54+
# password: ${{ secrets.GITHUB_TOKEN }}
55+
56+
- name: Login to Docker registry
57+
uses: docker/[email protected]
4558
with:
46-
registry: ghcr.io
47-
username: ${{ github.repository_owner }}
48-
password: ${{ secrets.GITHUB_TOKEN }}
59+
username: ${{ env.DOCKER_USERNAME }}
60+
password: ${{ env.DOCKER_PASSWORD }}
4961

5062
- name: Build and run Dev Container task
5163
uses: devcontainers/[email protected]
5264
with:
53-
provenance: false
5465
subFolder: ./templates/${{ matrix.dir }}
55-
imageName: ghcr.io/pnstack/codespace/${{ matrix.dir }}
56-
cacheFrom: ghcr.io/pnstack/codespace/${{ matrix.dir }}:latest
66+
imageName: npv2k1/codespace/${{ matrix.dir }}
67+
cacheFrom: npv2k1/codespace/${{ matrix.dir }}:latest
5768
imageTag: ${{ github.ref == 'refs/heads/master' && 'latest' || github.ref_name }}
5869
platform: linux/amd64,linux/arm64
5970
push: always
71+
72+
# - name: Build and run Dev Container task
73+
# uses: devcontainers/[email protected]
74+
# with:
75+
# subFolder: ./templates/${{ matrix.dir }}
76+
# imageName: ghcr.io/pnstack/codespace/${{ matrix.dir }}
77+
# cacheFrom: ghcr.io/pnstack/codespace/${{ matrix.dir }}:latest
78+
# imageTag: ${{ github.ref == 'refs/heads/master' && 'latest' || github.ref_name }}
79+
# platform: linux/amd64,linux/arm64
80+
# # push: always

0 commit comments

Comments
 (0)