-
Notifications
You must be signed in to change notification settings - Fork 26
50 lines (45 loc) · 1.39 KB
/
docker-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Docker
on:
schedule:
- cron: "20 6 * * *"
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout the repository
- uses: actions/checkout@v3
# We need to set up QEMU and Docker Buildx to build multi-architecture images
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# Install Poetry and install dependencies
- run: pipx install poetry
- uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: "poetry"
- run: poetry install
# Run tests
- run: poetry run pytest
- uses: docker/login-action@v2
if: github.event_name != 'pull_request'
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Build and push the image to Docker Hub
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64, linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: thelovinator/discord-twitter-webhooks:latest