npm: Audit fix #40
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Build & Push to Docker Hub" | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
env: | |
tarball_name: rtcp.tar.gz | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- 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 | |
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 |