forked from TYPO3/get.typo3.org
52 lines (52 loc) · 1.79 KB
/
deployment.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Deployment (CD)
on:
push:
branches:
- production
- develop
- stage
jobs:
deployment:
name: Deployment
runs-on: ubuntu-latest
steps:
- name: Setup SSH Key
env:
SSH_AUTH_SOCK: /tmp/ssh-auth.sock
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/deploy_key
chmod 0600 ~/.ssh/deploy_key
ssh-keygen -p -P "${{ secrets.SSH_PASSPHRASE }}" -N "" -f ~/.ssh/deploy_key
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add ~/.ssh/deploy_key
- uses: actions/checkout@v2
- name: Checkout submodules
shell: bash
run: |
# If your submodules are configured to use SSH instead of HTTPS please uncomment the following line
# git config --global url."https://github.com/".insteadOf "git@github.com:"
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Set up PHP Version
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: composer:v2, andres-montanez/magallanes
- name: Get Environment
id: environment
run: |
echo ::set-output name=target::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g')
- name: Deployment
env:
SSH_AUTH_SOCK: /tmp/ssh-auth.sock
run: |
mkdir -p ./.mage/logs
composer global exec mage deploy ${{ steps.environment.outputs.target }}
- name: Archive Logs
uses: actions/upload-artifact@v1
if: always()
with:
name: logs
path: .mage/logs