Skip to content

Commit

Permalink
feat(ci/cd) enabling pipelins to run on demand
Browse files Browse the repository at this point in the history
  • Loading branch information
uhryniuk committed Oct 8, 2024
1 parent e4b1d4e commit ef792d2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
32 changes: 18 additions & 14 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
name: Build and Push Docker Image

on:
push:
branches:
- main
workflow_dispatch:

jobs:
build-and-push:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest

steps:
Expand All @@ -21,16 +18,23 @@ jobs:
VERSION=$(grep '^version' Cargo.toml | head -n 1 | awk -F'"' '{print $2}')
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Version extracted: $VERSION"
- name: Log in to Docker Hub
uses: docker/login-action@v2
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build image
run: docker build -t docker.io/uhryniuk/tally:${{ env.VERSION }} .
username: ${{ secrets.DOCKER_USERNAME}}
password: ${{ secrets.DOCKER_PASSWORD}}
-
name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: uhryniuk/tally:${{ env.VERSION }}

- name: Push image
run: docker push docker.io/uhryniuk/tally:${{ env.VERSION }}

4 changes: 1 addition & 3 deletions .github/workflows/lint-build-test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Rust lint, build and test

on:
pull_request:
branches: [ "main" ]
on: ["push", "workflow_dispatch"]

env:
CARGO_TERM_COLOR: always
Expand Down

0 comments on commit ef792d2

Please sign in to comment.