Skip to content

Commit

Permalink
Upgrade github actions (#89)
Browse files Browse the repository at this point in the history
* Upgrade github actions

* Update actions/github-script@v6
  • Loading branch information
jotak authored Jan 23, 2023
1 parent 1db7150 commit c54e7eb
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Install make
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull_request_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
- name: install make
run: sudo apt-get install make
- name: set up go 1.x
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: run end-to-end tests
run: make tests-e2e
- name: upload e2e test logs
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/push_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ jobs:
- name: install make
run: sudo apt-get install make
- name: set up go 1.x
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: build images
run: make ci-images-build
- name: podman login to quay.io
Expand All @@ -36,14 +36,13 @@ jobs:
password: ${{ env.REGISTRY_PASSWORD }}
registry: quay.io
- name: get short sha
id: shortsha
run: echo "::set-output name=short_sha::$(git rev-parse --short HEAD)"
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: push to quay.io
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ env.IMAGE }}
tags: ${{ env.TAGS }} ${{ steps.shortsha.outputs.short_sha }}
tags: ${{ env.TAGS }} ${{ env.short_sha }}
registry: ${{ env.REGISTRY }}
- name: print image url
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"
13 changes: 6 additions & 7 deletions .github/workflows/push_image_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ jobs:
push-pr-image:
if: ${{ github.event.label.name == 'ok-to-test' }}
name: push PR image
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
go: ['1.18']
steps:
- name: install make
run: sudo apt-get install make
- name: set up go 1.x
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: "refs/pull/${{ github.event.number }}/merge"
- name: build images
Expand All @@ -37,16 +37,15 @@ jobs:
password: ${{ secrets.QUAY_SECRET }}
registry: quay.io
- name: get short sha
id: shortsha
run: echo "::set-output name=short_sha::$(git rev-parse --short HEAD)"
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: push to quay.io
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ env.IMAGE }}
tags: ${{ steps.shortsha.outputs.short_sha }}
tags: ${{ env.short_sha }}
registry: ${{ env.REGISTRY }}
- uses: actions/github-script@v5
- uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,26 @@ jobs:
go: ['1.18']
steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: validate tag
id: validate_tag
run: |
tag=`git describe --exact-match --tags 2> /dev/null`
if [[ $tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)?$ ]]; then
echo "$tag is a valid release tag"
set -e
echo "::set-output name=tag::$tag"
echo "tag=$tag" >> $GITHUB_ENV
else
echo "$tag is NOT a valid release tag"
exit 1
fi
- name: install make
run: sudo apt-get install make
- name: set up go 1.x
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: build images
run: SW_VERSION="${{ steps.validate_tag.outputs.tag }}" make image-build
run: SW_VERSION="${{ env.tag }}" make image-build
- name: podman login to quay.io
uses: redhat-actions/podman-login@v1
with:
Expand All @@ -51,7 +50,7 @@ jobs:
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ env.IMAGE }}
tags: ${{ steps.validate_tag.outputs.tag }}
tags: ${{ env.tag }}
registry: ${{ env.REGISTRY }}
- name: print image url
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"

0 comments on commit c54e7eb

Please sign in to comment.