Skip to content

Commit

Permalink
Buildah login fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisPalnitsky committed Mar 16, 2024
1 parent 7983776 commit 2933f34
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
name: build
on: [ push, workflow_dispatch ]

env:
REGISTRY: docker.io/orsol/go-rest-service-template

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.21

go-version: 1.21

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-api-integration-test
restore-keys: |
${{ runner.os }}-go
- name: Upgrade Buildah
shell: bash
run: apt-get update && apt-get -y install buildah=1.35.0

- name: Build
shell: bash
Expand All @@ -40,15 +36,14 @@ jobs:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
run: |
buildah login docker.io/orsol \
buildah login \
--username $DOCKERHUB_USERNAME \
--password $DOCKERHUB_TOKEN
--password $DOCKERHUB_TOKEN \
$REGISTRY
# publish image with application with three tags `latest`, commit-sha and branch with build number
- name: OCI build and push
shell: bash
env:
REGISTRY: orsol/go-rest-service-template
run: |
buildah bud --pull -t $REGISTRY\:${{ steps.vars_step.outputs.sha-short }} \
-t $REGISTRY\:${{ steps.vars_step.outputs.branch }}-${{ github.run_number }} \
Expand All @@ -62,9 +57,7 @@ jobs:
# That way it's easier to run it in kubernetes
- name: OCI Push Integration Tests
shell: bash
working-directory: ${{ inputs.working-directory }}
env:
REGISTRY: orsol/go-rest-service-template
working-directory: ${{ inputs.working-directory }}
run: |
buildah bud --pull -f Int.Dockerfile -t $REGISTRY\:${{ steps.vars_step.outputs.sha-short }}-test \
-t $REGISTRY\:${{ steps.vars_step.outputs.branch }}-${{ github.run_number }}-test \
Expand Down

0 comments on commit 2933f34

Please sign in to comment.