This repository has been archived by the owner on Jun 8, 2024. It is now read-only.
Containerisierung #19
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pull Request | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
load_code: | |
name: Load Code | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Archive code | |
uses: actions/upload-artifact@v2 | |
with: | |
name: source-code | |
path: . | |
build: | |
name: Build | |
needs: load_code | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download code | |
uses: actions/download-artifact@v2 | |
with: | |
name: source-code | |
path: . | |
- name: Setup Node 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install Dependencies | |
run: npm install | |
- name: Build | |
run: npm run build | |
buildx: | |
name: Buildx | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
login: | |
name: Login | |
needs: buildx | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- name: Login to GHCR | |
uses: docker/login-action@v3.0.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
metadata: | |
name: Metadata | |
needs: buildx | |
runs-on: ubuntu-latest | |
steps: | |
- id: meta | |
name: Extract metadata | |
uses: docker/metadata-action@v5.0.0 | |
with: | |
images: ghcr.io/${{ github.repository }}/stft | |
- name: Archive metadata | |
uses: actions/upload-artifact@v2 | |
with: | |
name: metadata | |
path: .docker | |
build_and_push: | |
name: Build and Push | |
needs: [load_code, buildx, login, metadata] | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
steps: | |
- name: Download code | |
uses: actions/download-artifact@v2 | |
with: | |
name: source-code | |
path: . | |
- name: Download metadata | |
uses: actions/download-artifact@v2 | |
with: | |
name: metadata | |
path: .docker | |
- name: Push to GHCR | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
platforms: linux/amd64,linux/arm64 |