Skip to content

Commit

Permalink
Improved pipeline to start Docker build before static files are created
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianLeChat committed Jun 8, 2024
1 parent b0c5f9f commit 9f434e7
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 12 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
name: CodeQL

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: 0 6 * * 1
workflow_call:
workflow_dispatch:

jobs:
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Docker Image CI

on:
workflow_call:
workflow_dispatch:

jobs:
codeql:
uses: ./.github/workflows/codeql.yml

eslint:
uses: ./.github/workflows/eslint.yml

build-image:
if: ${{ github.event_name != 'schedule' }}}
runs-on: ubuntu-latest
needs: [ codeql, eslint ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
flavor: latest=true
images: ghcr.io/${{ github.repository }}
tags: |
type=sha
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker Image and push
uses: docker/build-push-action@v5
with:
push: ${{ github.event_name == 'push' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
context: .
7 changes: 1 addition & 6 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
name: ESLint

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: 0 6 * * 1
workflow_call:
workflow_dispatch:

jobs:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: 0 6 * * 1
workflow_dispatch:

permissions:
Expand All @@ -17,11 +19,15 @@ concurrency:
cancel-in-progress: false

jobs:
docker-image:
uses: ./.github/workflows/docker-image.yml

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: [ docker-image ]
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down

0 comments on commit 9f434e7

Please sign in to comment.