Log which address server is proxying to #9
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: CI | |
on: | |
push: | |
branches: | |
- 'main' | |
tags: | |
- '*' | |
pull_request: | |
branches: | |
- 'main' | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 https://github.com/actions/checkout/releases/tag/v4.1.1 | |
- name: Use Node.js | |
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2 https://github.com/actions/setup-node/releases/tag/v3.8.2 | |
with: | |
node-version: 20 | |
- run: npm install | |
- run: npm test | |
docker: | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 https://github.com/actions/checkout/releases/tag/v4.1.1 | |
- | |
name: install node | |
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2 https://github.com/actions/setup-node/releases/tag/v3.8.2 | |
- run: npm install --omit=dev | |
- | |
name: 'Extract tag name' | |
shell: bash | |
run: echo "tag=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT | |
id: extract_tag | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0 https://github.com/docker/setup-qemu-action/releases/tag/v3.0.0 | |
- # See note on build-push-action github repo on why this needed | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 https://github.com/docker/setup-buildx-action/releases/tag/v3.0.0 | |
- | |
name: Login to Docker Hub | |
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 https://github.com/docker/login-action/releases/tag/v3.0.0 | |
with: | |
username: ${{ vars.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- | |
name: Build and push server Docker image | |
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0 https://github.com/docker/build-push-action/releases/tag/v5.1.0 | |
with: | |
context: . | |
file: Dockerfile-server | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ${{ vars.DOCKERHUB_USERNAME }}/p2proxy-server:${{ steps.extract_tag.outputs.tag }}, ${{ vars.DOCKERHUB_USERNAME }}/p2proxy-server:latest | |
- | |
name: Build and push client Docker image | |
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0 https://github.com/docker/build-push-action/releases/tag/v5.1.0 | |
with: | |
context: . | |
file: Dockerfile-client | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ${{ vars.DOCKERHUB_USERNAME }}/p2proxy-client:${{ steps.extract_tag.outputs.tag }}, ${{ vars.DOCKERHUB_USERNAME }}/p2proxy-client:latest |