Skip to content

Build Docker Container #13

Build Docker Container

Build Docker Container #13

name: Build Docker Container
on: [workflow_dispatch]
jobs:
generate-requirements.txt:

Check failure on line 4 in .github/workflows/build-container.yml

View workflow run for this annotation

GitHub Actions / Build Docker Container

Invalid workflow file

The workflow is not valid. .github/workflows/build-container.yml (Line: 4, Col: 3): The identifier 'generate-requirements.txt' is invalid. IDs may only contain alphanumeric characters, '_', and '-'. IDs must start with a letter or '_' and and must be less than 100 characters.
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: install poetry
run: python3 -m pip install poetry
- name: install poetry dependencies
run: poetry install
- name: export requirements.txt
run: poetry export --without-hashes -f requirements.txt --output requirements.txt
- name: upload requirements.txt
uses: actions/upload-artifact@v3
with:
name: requirements
path: requirements.txt
build-and-publish-amd64:
runs-on: ubuntu-latest
needs: generate-requirements
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Download requirements.txt
uses: actions/download-artifact@v3
with:
name: requirements
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to ghcr
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build amd64 image
run: docker build -t ghcr.io/felix920506/jellychord:latest-amd64 --platform linux/amd64 .
- name: push amd64 image
run: docker push ghcr.io/felix920506/jellychord:latest-amd64
build-and-publish-arm64:
runs-on: ubuntu-24.04-arm
needs: generate-requirements
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Download requirements.txt
uses: actions/download-artifact@v3
with:
name: requirements
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to ghcr
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build arm64 image
run: docker build -t ghcr.io/felix920506/jellychord:latest-arm64 --platform linux/arm64 .
- name: push arm64 image
run: docker push ghcr.io/felix920506/jellychord:latest-arm64