Skip to content

Commit

Permalink
Add push step to workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmartinspt committed Oct 24, 2023
1 parent 42e2384 commit d5219f7
Showing 1 changed file with 35 additions and 4 deletions.
39 changes: 35 additions & 4 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,47 @@ env:
SECRET_KEY: insecure_test_key

jobs:
run-image:
imaging:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v3
- id: commit
uses: prompt/actions-commit-hash@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image
run: DOCKER_BUILDKIT=1 docker build --tag dqlite-io .
uses: docker/build-push-action@v5
with:
context: .
load: true
push: false
tags: ghcr.io/canonical/dqlite.io:${{ steps.commit.outputs.short }}
- name: Run image
run: |
docker run -d -p 80:80 --env SECRET_KEY=insecure_secret_key dqlite-io
docker run -d -p 80:80 --env SECRET_KEY=insecure_secret_key ghcr.io/canonical/dqlite.io:${{ steps.commit.outputs.short }}
sleep 1 && curl --head --fail --retry-delay 5 --retry 10 --retry-connrefused http://localhost
- name: Push image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ghcr.io/canonical/dqlite.io:${{ steps.commit.outputs.short }}

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

run-dotrun:
runs-on: ubuntu-latest
Expand Down

0 comments on commit d5219f7

Please sign in to comment.