-
Notifications
You must be signed in to change notification settings - Fork 3
37 lines (34 loc) · 1.14 KB
/
docker-ci.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
name: Docker CI
on:
push:
branches: [ main ]
jobs:
build:
name: Builds the Docker image
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Build the image
run: docker build -t docker.pkg.github.com/microup/vbalancer/vbalancer:latest .
- name: Save the image
run: docker save -o image.tar docker.pkg.github.com/microup/vbalancer/vbalancer:latest
- name: Upload image to artifacts
uses: actions/upload-artifact@v1
with:
name: image
path: image.tar
publish:
name: Publish the Docker image
needs: build
runs-on: [ubuntu-latest]
steps:
- name: Download the image from artifacts
uses: actions/download-artifact@v1
with:
name: image
- name: Load the image
run: docker load -i image/image.tar
- name: Login to docker.pkg.github.com
run: echo ${{ secrets.TOKEN }} | docker login docker.pkg.github.com --username ${{ secrets.USERNAME }} --password-stdin
- name: Publish the image
run: docker push docker.pkg.github.com/microup/vbalancer/vbalancer:latest