Skip to content

Commit c0ec536

Browse files
authored
Update CI/CD
1 parent d37fc01 commit c0ec536

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

.github/workflows/alpha.yml

+7-13
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ permissions:
1212
jobs:
1313
validate:
1414
name: Symfony (PHP ${{ matrix.php-versions }})
15-
runs-on: self-hosted
15+
runs-on: ubuntu-latest
1616

1717
# Docs: https://docs.github.com/en/actions/using-containerized-services
1818
services:
@@ -84,7 +84,7 @@ jobs:
8484
# run: simple-phpunit --coverage-text
8585
deploy:
8686
name: Deploy image
87-
runs-on: self-hosted
87+
runs-on: ubuntu-latest
8888
needs: validate
8989
steps:
9090
- uses: actions/checkout@v4
@@ -101,16 +101,10 @@ jobs:
101101
with:
102102
context: .
103103
push: true
104-
tags: registry.realt.community/symfony-php-api-realt:${{ github.ref_name }}
104+
tags: ${{ secrets.DOCKER_REGISTRY }}/api-php:${{ github.ref_name }}
105105

106106
- name: Configure SSH
107107
run: |
108-
if "${{ github.ref_name }}" == "alpha"
109-
then
110-
echo "alpha-branch"
111-
else
112-
echo "not alpha-branch"
113-
fi
114108
mkdir -p ~/.ssh/
115109
echo "$SSH_KEY" > ~/.ssh/staging.key
116110
chmod 600 ~/.ssh/staging.key
@@ -130,10 +124,10 @@ jobs:
130124

131125
- name: Update alpha environment
132126
run: |
133-
ssh staging 'export DOCKER_BRANCH=${{ github.ref_name }}
134-
cd /home/realt/docker/api/${DOCKER_BRANCH}-git
127+
ssh staging 'export DOCKER_BRANCH=${{ github.ref_name }} DOCKER_REGISTRY=${{ secrets.DOCKER_REGISTRY }}
128+
cd /var/docker/api/${DOCKER_BRANCH}
135129
git pull origin ${{ github.ref_name }}
136-
docker compose --file docker-compose.${{ github.ref_name }}.yml pull
130+
docker compose --file docker-compose-${{ github.ref_name }}.yml pull
137131
docker login -u ${{ secrets.DOCKER_LOGIN }} -p ${{ secrets.DOCKER_PASSWD }} ${{ secrets.DOCKER_REGISTRY }}
138-
docker compose --project-name ${{ github.ref_name }}_php-api --file docker-compose.${{ github.ref_name }}.yml up -d'
132+
docker compose --project-name ${{ github.ref_name }}-api_php --file docker-compose-${{ github.ref_name }}.yml up -d'
139133
# Add migration !?

0 commit comments

Comments
 (0)