forked from JaimeObregon/retrosantander
-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (37 loc) · 1 KB
/
master.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
name: Github Actions
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
jobs:
frontend:
runs-on: ubuntu-latest
services:
docker:
image: docker:27.0-dind
steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: |
docker compose -f docker-compose.prod.yml build
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker Compose
run: |
docker compose -f docker-compose.prod.yml push
- name: Configure SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.AZURE_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan 20.124.2.0 >> ~/.ssh/known_hosts
- name: Deploy code
run: |
ssh [email protected] "cd ./retrogasteiz && ./deploy.sh"