-
Notifications
You must be signed in to change notification settings - Fork 102
42 lines (42 loc) · 1.67 KB
/
release-on-master.yml
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
40
41
42
name: Release Main Snapshot
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Get current time
uses: gerred/[email protected]
- name: Checkout Code
uses: actions/checkout@v1
id: current-time
- name: Login to Github Package Registry
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_GITHUB_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_GITHUB_KEY }}
DOCKER_REGISTRY_URL: "docker.pkg.github.com"
run: docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD} ${DOCKER_REGISTRY_URL}
- name: Build and tag with SHA
env:
REPOSITORY: ${{ secrets.REPOSITORY }}
BUILD_DATE: ${{ steps.current-time.outputs.time }}
run: |
docker build \
--build-arg git_version_arg=github.com/kudobuilder/kudo/pkg/version.gitVersion=v$GITHUB_SHA \
--build-arg git_commit_arg=github.com/kudobuilder/kudo/pkg/version.gitCommit=$GITHUB_SHA \
--build-arg build_date_arg=github.com/kudobuilder/kudo/pkg/version.buildDate=$BUILD_DATE . -t docker.pkg.github.com/$REPOSITORY:$GITHUB_SHA
- name: Tag with `main`
env:
REPOSITORY: ${{ secrets.REPOSITORY }}
run: |
docker tag docker.pkg.github.com/$REPOSITORY:$GITHUB_SHA docker.pkg.github.com/$REPOSITORY:main
- name: Push image with commit SHA
env:
REPOSITORY: ${{ secrets.REPOSITORY }}
run: docker push docker.pkg.github.com/$REPOSITORY:$GITHUB_SHA
- name: Push main tag
env:
REPOSITORY: ${{ secrets.REPOSITORY }}
run: docker push docker.pkg.github.com/$REPOSITORY:main