-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (48 loc) · 1.3 KB
/
build.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
43
44
45
46
47
48
49
50
51
52
name: "Build & Push to Docker Hub"
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
tarball_name: rtcp.tar.gz
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v12
with:
name: myme
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Build Docker image
run: nix build -o ${{ env.tarball_name }}
- name: Archive Docker Image
uses: actions/upload-artifact@v3
with:
name: docker-image
path: ${{ env.tarball_name }}
push:
needs: [build]
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: Download Docker Image
uses: actions/download-artifact@v3
with:
name: docker-image
-
name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
-
name: Push image to Docker Hub
run: |
docker load < ${{ env.tarball_name }}
docker tag rtcp:latest myme/rtcp:latest
docker push myme/rtcp:latest