add: tag spliting #15
Workflow file for this run
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: Deploy to Remote Server | |
on: | |
push: | |
branches: | |
- add/1205782676034164_autotest-deplyoment | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Free Disk Space (insightsengineering/disk-space-reclaimer)" | |
uses: insightsengineering/disk-space-reclaimer@v1.1.0 | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | |
with: | |
images: ${{ secrets.DOCKER_REG_PARACHAIN}} | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=ref,event=tag | |
# - name: Build and push | |
# uses: docker/build-push-action@v3 | |
# with: | |
# context: . | |
# file: scripts/Dockerfile | |
# push: ${{ github.event_name != 'pull_request' }} | |
# tags: ${{ steps.meta.outputs.tags }} | |
# labels: ${{ steps.meta.outputs.labels }} | |
- name: executing remote ssh commands using ssh key | |
uses: appleboy/ssh-action@v1.0.0 | |
with: | |
host: ${{ secrets.AUTOTEST_HOST }} | |
username: ${{ secrets.AUTOTEST_USERNAME }} | |
key: ${{ secrets.SSH_KEY_AUTOTEST }} | |
port: ${{ secrets.AUTOTEST_SSH_PORT }} | |
script: | | |
cd /home/jay/parachain-launch/yoyo/ | |
sudo TAG=$(echo ${{ steps.meta.outputs.tags}} | sed -n 's/[^:]*:\(.*\)/\1/p')" docker compose down -v | |
sudo TAG=$(echo ${{ steps.meta.outputs.tags}} | sed -n 's/[^:]*:\(.*\)/\1/p')" docker compose up -d --build --remove-orphans |