-
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.
- Loading branch information
Showing
2 changed files
with
78 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
on: [push, pull_request] | ||
name: CI | ||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
go-version: [1.14.x, 1.15.x] | ||
os: [ubuntu-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Install Task | ||
run: curl -sL https://taskfile.dev/install.sh | sh | ||
- name: Run CI Task | ||
run: ./bin/task ci | ||
build: | ||
needs: [test] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.15.x | ||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Install Task | ||
run: curl -sL https://taskfile.dev/install.sh | sh | ||
- name: Build docker image | ||
run: ./bin/task docker | ||
- name: Save image | ||
run: | | ||
docker save teliaoss/github-pr-resource:dev > github-pr-resource.tar | ||
- name: Pass image to next job | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: image | ||
path: github-pr-resource.tar | ||
release: | ||
needs: [build] | ||
if: github.ref == 'refs/heads/main' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: image | ||
- run: | | ||
docker load < github-pr-resource.tar | ||
- uses: docker/[email protected] | ||
with: | ||
username: tenjaa | ||
password: ${{ secrets.docker_password }} | ||
- name: Login to Public ECR | ||
uses: docker/[email protected] | ||
with: | ||
registry: public.ecr.aws | ||
username: ${{ secrets.ECR_ACCESS_KEY_ID }} | ||
password: ${{ secrets.ECR_SECRET_ACCESS_KEY }} | ||
- name: Login to GitHub Container Registry | ||
uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Update latest tag | ||
run: | | ||
docker tag teliaoss/github-pr-resource:dev tenjaa/github-pr-resource:latest | ||
docker tag teliaoss/github-pr-resource:dev public.ecr.aws/f1s7y4s6/github-pr-resource:latest | ||
docker tag teliaoss/github-pr-resource:dev ghcr.io/tenjaa/github-pr-resource:latest | ||
docker push tenjaa/github-pr-resource:latest | ||
docker push public.ecr.aws/f1s7y4s6/github-pr-resource:latest | ||
docker push ghcr.io/tenjaa/github-pr-resource:latest |
This file was deleted.
Oops, something went wrong.