forked from padok-team/github-actions-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (37 loc) · 908 Bytes
/
Copy pathworkflow.yml
File metadata and controls
39 lines (37 loc) · 908 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: main-workflow
env:
IMAGE_REPOSITORY: padok-team/foobar
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "^1.14"
- name: Print Go version
run: go version
- name: Run unit tests
run: go test -v ./...
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v3
- name: Build and push container image
uses: docker/build-push-action@v1
with:
secrets: |
"github_token=${{ secrets.GITHUB_TOKEN }}"
repository: ${{ env.IMAGE_REPOSITORY }}
tag_with_ref: true
tag_with_sha: true