Skip to content

Commit

Permalink
new build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Corya committed Feb 5, 2024
1 parent c5a58e2 commit 50bc089
Showing 1 changed file with 37 additions and 18 deletions.
55 changes: 37 additions & 18 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,75 @@
name: Master Branch CI

# For all pushes to the main branch run the tests and push the image to the
# GitHub registry under an edge tag so we can use it for the nightly
# integration tests
on:
workflow_dispatch:
push:
branches: master
branches:
- 'master'
tags:
- 'v*'
pull_request:
branches:
- 'master'

jobs:
docker:
runs-on: ubuntu-latest
steps:

- name: Check Out Repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: coryaent/lowery

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: ./
file: ./Dockerfile
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: stevecorya/lowery:latest
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache

- name: Update Docker Hub description
uses: peter-evans/dockerhub-description@v2
- name: Update Docker Hub information
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
repository: stevecorya/lowery
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
short-description: ${{ github.event.repository.description }}
enable-url-completion: true

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
Expand All @@ -59,6 +78,6 @@ jobs:
uses: yanzay/[email protected]
if: always()
with:
chat: ${{ secrets.TELEGRAM_USER_ID }} # user id or channel name secret
token: ${{ secrets.TELEGRAM_BOT_TOKEN }} # token secret
status: ${{ job.status }} # do not modify this line
chat: ${{ secrets.TELEGRAM_USER_ID }}
token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
status: ${{ job.status }}

0 comments on commit 50bc089

Please sign in to comment.