releasef fix mobile view of acitivty #583
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: Release frontend | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release-docker: | |
if: "contains(github.event.head_commit.message, 'releasef')" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set env | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' | |
run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF:10} | |
- name: Log in to Docker Hub | |
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | |
with: | |
context: ./frontend | |
push: true | |
tags: sammers/pvpqnet-frontend:latest | |
- name: Deploy app PvPq.net frontend to production | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.APP_HOST }} | |
username: ${{ secrets.SSH_HOST_USERNAME }} | |
key: ${{ secrets.SSH_KEY }} | |
script: | | |
docker pull sammers/pvpqnet-frontend:latest | |
docker stop pvpqnet-frontend | |
docker rm -f pvpqnet-frontend | |
docker run --restart=always --name pvpqnet-frontend -d -p9001:9001 sammers/pvpqnet-frontend:latest | |
release-normal: | |
if: false | |
runs-on: ubuntu-latest | |
env: | |
CI: false | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set env | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' | |
run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF:10} | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- run: npm install | |
working-directory: ./frontend | |
- run: REACT_APP_BASE_API_URL=https://pvpq.net npm run build | |
working-directory: ./frontend | |
- name: Scp files to server | |
uses: appleboy/scp-action@master | |
with: | |
host: ${{ secrets.APP_HOST }} | |
username: ${{ secrets.SSH_HOST_USERNAME }} | |
key: ${{ secrets.SSH_KEY }} | |
source: './frontend/build/*' | |
target: '/var/www/citest' | |
- name: Copy frontend to ngnix | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.APP_HOST }} | |
username: ${{ secrets.SSH_HOST_USERNAME }} | |
key: ${{ secrets.SSH_KEY }} | |
script: | | |
cd /var/www/citest/frontend/build/ | |
rm -rf /var/www/pvpqnet | |
mkdir -p /var/www/pvpqnet | |
cp -R ./* /var/www/pvpqnet/ | |
rm -rf /var/www/citest/frontend/build/ |