Add support for arm64
This commit is contained in:
65
.github/workflows/docker-publish.yml
vendored
65
.github/workflows/docker-publish.yml
vendored
@ -4,9 +4,9 @@ on:
|
|||||||
schedule:
|
schedule:
|
||||||
- cron: "20 6 * * *"
|
- cron: "20 6 * * *"
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [master]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [master]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
env:
|
env:
|
||||||
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
|
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
|
||||||
@ -21,40 +21,59 @@ jobs:
|
|||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Download code
|
||||||
- run: pipx install poetry
|
uses: actions/checkout@v3
|
||||||
- uses: actions/setup-python@v4
|
|
||||||
|
- name: Set up QEMU for cross-platform Docker images
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
with:
|
with:
|
||||||
python-version: "3.10"
|
platforms: all
|
||||||
cache: 'poetry'
|
|
||||||
- run: poetry install
|
- name: Set up Docker Buildx
|
||||||
- run: poetry run pytest
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Install Poetry
|
||||||
|
run: pipx install poetry
|
||||||
|
|
||||||
|
- name: Setup Python 3.11
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: "3.11"
|
||||||
|
cache: "poetry"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: poetry install
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: poetry run pytest
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Extract Docker metadata
|
|
||||||
id: meta
|
- name: Build and push Docker image to Docker Hub
|
||||||
uses: docker/metadata-action@v4
|
|
||||||
with:
|
|
||||||
images: |
|
|
||||||
thelovinator/discord-reminder-bot
|
|
||||||
ghcr.io/thelovinator1/discord-reminder-bot
|
|
||||||
flavor: latest=${{ github.ref == 'refs/heads/master' }}
|
|
||||||
- name: Build and push Docker image
|
|
||||||
id: build-and-push
|
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
|
platforms: linux/amd64, linux/arm64
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: thelovinator/discord-reminder-bot:latest
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
|
- name: Build and push Docker image to GitHub Container Registry
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: linux/amd64, linux/arm64
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ghcr.io/thelovinator1/discord-reminder-bot:latest
|
||||||
|
Reference in New Issue
Block a user