diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c7e0b5e..aee4a18 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,33 +2,34 @@ name: "Build & Push to Docker Hub" on: push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] - + branches: ["main"] + env: tarball_name: rtcp.tar.gz - + jobs: build: + name: Build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2.4.0 - - 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 }} - + - uses: actions/checkout@v3 + - 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 @@ -38,14 +39,12 @@ jobs: uses: actions/download-artifact@v3 with: name: docker-image - - - name: Login to Docker Hub + - 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 + - name: Push image to Docker Hub run: | docker load < ${{ env.tarball_name }} docker tag rtcp:latest myme/rtcp:latest