-
Notifications
You must be signed in to change notification settings - Fork 25
36 lines (33 loc) · 1.12 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: release
on:
push:
tags: ['v*']
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Add SSH config
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
mkdir -p /home/runner/.ssh
echo "${{ secrets.ANVIL_HOST }}" > /home/runner/.ssh/known_hosts
echo "${{ secrets.ANVIL_SSH_KEY }}" > /home/runner/.ssh/github_actions
chmod 600 /home/runner/.ssh/github_actions
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add /home/runner/.ssh/github_actions
- name: Deploy to production published
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
git config --global user.name "GitHubActions"
git config --global user.email "[email protected]"
# Get the latest tag by semantic versioning
LATEST_TAG=$(git tag | sort -V | tail -n1)
git checkout $LATEST_TAG
git remote add anvil "${{ secrets.ANVIL_REPO_URL }}"
git push anvil HEAD:published --force
git push --tags anvil