diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 1a7038f..1ec1a54 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -1,12 +1,7 @@ name: CodeQL on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - schedule: - - cron: 0 6 * * 1 + workflow_call: workflow_dispatch: jobs: diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..0cd35e7 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -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: . diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index 7751056..ea326d6 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -1,12 +1,7 @@ name: ESLint on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - schedule: - - cron: 0 6 * * 1 + workflow_call: workflow_dispatch: jobs: diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 0e4e7fc..9c0b028 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -5,6 +5,8 @@ on: branches: [ master ] pull_request: branches: [ master ] + schedule: + - cron: 0 6 * * 1 workflow_dispatch: permissions: @@ -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