Skip to content

Commit

Permalink
update ci to newer version
Browse files Browse the repository at this point in the history
  • Loading branch information
ModischFabrications committed Jan 30, 2024
1 parent b9b47fe commit 9cd48cd
Showing 1 changed file with 23 additions and 22 deletions.
45 changes: 23 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ name: Build, Test, Deploy
on:
push:
branches:
- 'master'
- 'main'
- "master"
- "main"
tags:
- 'v*'
- "v*"
pull_request:
workflow_dispatch:

permissions:
contents: read
packages: write ## Github container registry
packages: write ## Github container registry
# deployments: write ## Github Pages

concurrency: ci-${{ github.ref }}
Expand All @@ -22,24 +22,24 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest ] #, windows-latest ] # windows takes ~3x longer, not worth the cost for larger projects
os: [ubuntu-latest] #, windows-latest ] # windows takes ~3x longer, not worth the cost for larger projects

runs-on: ${{ matrix.os }}
timeout-minutes: 5

steps:
# - name: Dump GitHub context
# env:
# GITHUB_CONTEXT: ${{ toJson(github) }}
# run: echo "$GITHUB_CONTEXT"
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"

- name: Checkout 🛎️
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python ⚙️
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11" # keep in sync with pipfile
python-version: "3.11" # keep in sync with pipfile

- name: Install dependencies ⚙️
run: |
Expand All @@ -59,20 +59,21 @@ jobs:
build-and-push-docker:
needs: build-and-test
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) ||
startsWith(github.ref, 'refs/tags/v') && github.event.base_ref == format('refs/heads/{0}', github.event.repository.default_branch)
if:
github.ref == 'refs/heads/{{ github.event.repository.default_branch }}' ||
(startsWith(github.ref, 'refs/tags/v') && github.event.base_ref == 'refs/heads/{{ github.event.repository.default_branch }}')

runs-on: ubuntu-latest
timeout-minutes: 20

steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
uses: actions/checkout@v4

# https://github.com/docker/metadata-action
- name: Export Metadata for Docker 🖊️
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
modischfabrications/cutsolver
Expand All @@ -83,32 +84,32 @@ jobs:
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU ⚙
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx ⚙
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Report Buildx platforms 🖊️
run: echo ${{ steps.buildx.outputs.platforms }}

- name: Login to DH 👤
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GHCR 👤
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

# https://github.com/docker/build-push-action
- name: Build and push to DH & GHCR 📦
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7
Expand All @@ -119,7 +120,7 @@ jobs:
cache-to: type=inline

- name: Update DH description 🖊️
uses: peter-evans/dockerhub-description@v3
uses: peter-evans/dockerhub-description@v5
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down

0 comments on commit 9cd48cd

Please sign in to comment.