forked from operator-framework/operator-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: replace travis completely with github actions (operator-framework…
- Loading branch information
Eric Stroczynski
authored
Mar 3, 2021
1 parent
d37a747
commit d940893
Showing
20 changed files
with
279 additions
and
476 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
name: deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
# Job to test release steps. This will only create a release remotely if run on a tagged commit. | ||
goreleaser: | ||
name: goreleaser | ||
runs-on: ubuntu-18.04 | ||
environment: deploy | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: install | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.15.5 | ||
|
||
- name: gpg init | ||
if: github.event_name != 'pull_request' | ||
run: .ci/gpg/create-keyring.sh | ||
env: | ||
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} | ||
|
||
- name: release | ||
run: | | ||
if [[ $GITHUB_REF != refs/tags/* ]]; then | ||
export DRY_RUN=1 | ||
fi | ||
make release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Job matrix for image builds. | ||
images: | ||
name: images | ||
runs-on: ubuntu-18.04 | ||
environment: deploy | ||
strategy: | ||
matrix: | ||
id: ["operator-sdk", "ansible-operator", "helm-operator", "scorecard-test", "scorecard-test-kuttl"] | ||
steps: | ||
|
||
- name: set up qemu | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: set up buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: quay.io login | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.QUAY_USERNAME }} | ||
password: ${{ secrets.QUAY_PASSWORD }} | ||
registry: quay.io | ||
|
||
- name: create tags | ||
id: tags | ||
run: | | ||
IMG=quay.io/operator-framework/${{ matrix.id }} | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
TAG=${GITHUB_REF#refs/tags/} | ||
MAJOR_MINOR=${TAG%.*} | ||
echo ::set-output name=tags::${IMG}:${TAG},${IMG}:${MAJOR_MINOR} | ||
elif [[ $GITHUB_REF == refs/heads/* ]]; then | ||
TAG=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g') | ||
echo ::set-output name=tags::${IMG}:${TAG} | ||
elif [[ $GITHUB_REF == refs/pull/* ]]; then | ||
TAG=pr-${{ github.event.number }} | ||
echo ::set-output name=tags::${IMG}:${TAG} | ||
fi | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
file: ./images/${{ matrix.id }}/Dockerfile | ||
context: . | ||
# s390x is not supported by the scorecard-test-kuttl base image. | ||
platforms: linux/amd64,linux/arm64,linux/ppc64le${{ matrix.id != 'scorecard-test-kuttl' && ',linux/s390x' || '' }} | ||
push: ${{ (github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == format('refs/heads/{0}', github.event.repository.default_branch) )) }} | ||
tags: ${{ steps.tags.outputs.tags }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.