Skip to content

Commit 7561898

Browse files
committed
Rework wpfc.io to use common build dir
1 parent 6337e7e commit 7561898

File tree

2 files changed

+10
-21
lines changed

2 files changed

+10
-21
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@ jobs:
7878
- name: Create Zip
7979
run: zip -qq -r "${{ env.PROJECT_NAME }}.zip" ${{ env.PROJECT_NAME }}/
8080

81-
- name: Remove the (temporary) zip directory
82-
run: rm -r ${{ env.PROJECT_NAME }}
83-
8481
- name: Prepare builds directory
8582
run: mkdir -p ${{ env.builds-directory }}/${{ env.PROJECT_NAME }}/${{ env.CI_REF_NAME_SLUG }}
8683

@@ -92,3 +89,6 @@ jobs:
9289
with:
9390
name: ${{ env.PROJECT_NAME }}
9491
path: ${{ env.PROJECT_NAME }}
92+
93+
- name: Remove the (temporary) zip directory
94+
run: rm -r ${{ env.PROJECT_NAME }}

.github/workflows/qa-deploy.yml

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
# branches:
55
# - develop
66

7+
env:
8+
builds-directory: ~/builds/athemes
9+
710
jobs:
811
build:
912
# We are using @feature/394-modular-workflows just for testing
@@ -13,12 +16,9 @@ jobs:
1316
runs-on: self-hosted
1417
needs: build
1518
steps:
16-
- name: Setup SSH key
17-
run: |
18-
mkdir -p ~/.ssh
19-
echo "${{ secrets.WPFORMS_TEST_DOCKER_SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
20-
chmod 600 ~/.ssh/id_ed25519
21-
chmod 700 ~/.ssh
19+
# This action exposes GitHub environment variables, making them available in subsequent steps.
20+
- name: GitHub Environment Variables Action
21+
uses: FranzDiebold/[email protected]
2222

2323
# Sets a project name based on the GitHub repository name.
2424
# It extracts the repository name, converts it to lowercase, and saves it as an environment variable PROJECT_NAME.
@@ -28,16 +28,6 @@ jobs:
2828
repo_short_name="${repo_full_name##*/}"
2929
echo "PROJECT_NAME=${repo_short_name,,}" >> $GITHUB_ENV
3030
31-
- name: Download artifact
32-
uses: actions/download-artifact@v5
33-
with:
34-
name: ${{ env.PROJECT_NAME }}
35-
path: ${{ env.PROJECT_NAME }}
36-
- run: zip -qq -r ${{ env.PROJECT_NAME }}.zip ${{ env.PROJECT_NAME }}
37-
38-
- name: Clean up old zip artifact on server
39-
run: ssh -o StrictHostKeyChecking=no [email protected] "rm -rf /sites/qa-botiga.athemes.wpfc.io/files/wp-content/themes/${{ env.PROJECT_NAME }}.zip"
40-
4131
- name: Upload to qa-botiga.athemes.wpfc.io
4232
run: |
4333
rsync --rsh="ssh -o StrictHostKeyChecking=no" \
@@ -48,8 +38,7 @@ jobs:
4838
--human-readable \
4939
--progress \
5040
--whole-file \
51-
--remove-source-files \
52-
${{ env.PROJECT_NAME }}.zip \
41+
${{ env.builds-directory }}/${{ env.PROJECT_NAME }}/${{ env.CI_REF_NAME_SLUG }}/${{ env.PROJECT_NAME }}.zip \
5342
[email protected]:/sites/qa-botiga.athemes.wpfc.io/files/wp-content/themes/
5443
5544
- name: Install on qa-botiga.athemes.wpfc.io

0 commit comments

Comments
 (0)