Skip to content

Commit

Permalink
chore(ci): pre-build and publish of DevContainer
Browse files Browse the repository at this point in the history
* Added build and push to GHCR capabilities
* Provde a default `github.actor` for the `build` job in the `main.yml` workflow file.
* Add `.dockerignore` file to exclude unnecessary files from the Docker build context.
* Update syntax for act excludes in .dockerignore and .gitignore files.
* Added a context to the build in the .devcontainer.json file.

Closes: #4
  • Loading branch information
petersellars committed Oct 5, 2024
1 parent b42385b commit 0459f2d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "Catosplace Engineering Base Dev Container",
"build": {
"dockerfile": "Dockerfile"
"dockerfile": "Dockerfile",
"context": ".devcontainer"
},
"features": {
"ghcr.io/devcontainers/features/node:1": {
Expand Down
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# act
*.env
*.secrets
11 changes: 9 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ jobs:
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
username: ${{ github.actor || 'psellars' }}
password: ${{ secrets.GITHUB_TOKEN }}


# Per-build the container image
- name: Pre-build the container image
uses: devcontainers/ci@v0.3
with:
imageName: ghcr.io/catosplace-devcontainers/engineering-base
cacheFrom: ghcr.io/catosplace-devcontainers/engineering-base
push: always

6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# act environment file
.env
.secrets
# act
*.env
*.secrets

# Dependency directories
node_modules/

0 comments on commit 0459f2d

Please sign in to comment.