Skip to content

Deploy Proxy

Deploy Proxy #101

Workflow file for this run

name: Deploy Proxy
on:
workflow_dispatch:
jobs:
build:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Check Out Repo
uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ secrets.DOCKER_HUB_USERNAME }}/proxy
tags: type=raw,value=latest
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
with:
context: ./proxy16/
file: ./proxy16/dockerfile
builder: ${{ steps.buildx.outputs.name }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
deploy:
needs: build
runs-on: ${{ matrix.runner }}
strategy:
matrix:
runner: [ proxy.1, proxy.2, proxy.3, proxy.6 ]
steps:
- name: Pull && Up proxy container
run: /data/proxy_pull_up.sh
shell: bash
- name: Reset nginx cache
run: /data/reset_cache.sh
shell: bash