Skip to content

Commit

Permalink
fix: separate images into multiple workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
phorcys420 committed Aug 5, 2024
1 parent 1203a2e commit 05f46fb
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 24 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/build-and-push-base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Dev Container Build and Push base image

on:
workflow_dispatch:
push:
branches:
- "main"
pull_requests:
branches:
- "main"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
if: github.event_name != 'pull_request'

- name: Pre-build base image
uses: devcontainers/[email protected]
with:
subFolder: .github/devcontainer/base
imageName: ghcr.io/${{ github.repository }}/base
cacheFrom: ghcr.io/${{ github.repository }}/base
push: ${{ github.event_name != 'pull_request' && 'always' || 'never' }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Dev Container Build and Push Image
name: Dev Container Build and Push images

on:
workflow_dispatch:
Expand All @@ -10,29 +10,6 @@ on:
- "main"

jobs:
build-base:
runs-on: ubuntu-latest
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
if: github.event_name != 'pull_request'

- name: Pre-build base image
uses: devcontainers/[email protected]
with:
subFolder: .github/devcontainer/base
imageName: ghcr.io/${{ github.repository }}/base
cacheFrom: ghcr.io/${{ github.repository }}/base
push: ${{ github.event_name != 'pull_request' && 'always' || 'never' }}

build:
runs-on: ubuntu-latest
strategy:
Expand Down

0 comments on commit 05f46fb

Please sign in to comment.