diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index d440c84a4..deb9ffd94 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -33,9 +33,6 @@ jobs: - name: Install dependencies run: make install - - name: Build the website - run: make build MODE=production - - name: Set up SSH key uses: webfactory/ssh-agent@v0.9.1 with: @@ -44,5 +41,7 @@ jobs: - name: ssh keyscan run: ssh-keyscan "static.europython.eu" > ~/.ssh/known_hosts - - name: Deploy to server + - name: Build and Deploy to server + env: + MODE: "production" run: make deploy FORCE_DEPLOY=true diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 738c9b9ae..8a4f99812 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -36,13 +36,6 @@ jobs: - name: Install dependencies run: make install - - name: Build the website - env: - BRANCH: "${{ env.GITHUB_BRANCH_NAME }}" - GIT_VERSION: "${{ env.GITHUB_COMMIT_HASH }}" - MODE: "preview" - run: make build - - name: Set up SSH key uses: webfactory/ssh-agent@v0.9.1 with: @@ -51,9 +44,11 @@ jobs: - name: ssh keyscan run: ssh-keyscan "static.europython.eu" > ~/.ssh/known_hosts - - name: Upload preview + - name: Build and upload preview env: BRANCH: "${{ env.GITHUB_BRANCH_NAME }}" + GIT_VERSION: "${{ env.GITHUB_COMMIT_HASH }}" + MODE: "preview" run: make preview - name: Get safe branch and export to env diff --git a/.github/workflows/update-data.yml b/.github/workflows/update-data.yml deleted file mode 100644 index c38123318..000000000 --- a/.github/workflows/update-data.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: 🔄 Update data - -on: - workflow_dispatch: - schedule: - - cron: "0 8 * * *" - -jobs: - update-data: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Run download-data script - run: pipx run scripts/download-data.py - - - name: Install pre-commit - run: pip install pre-commit - - - name: Run pre-commit - run: pre-commit run --all-files - continue-on-error: true - - - name: Open pull request - uses: peter-evans/create-pull-request@v6 - with: - author: - github-actions[bot] - committer: - github-actions[bot] - commit-message: "🆕 Update data" - title: "🆕 Update data" - body: "🆕 Update data" - branch: "update-data" - labels: "update-data" diff --git a/Makefile b/Makefile index 98763ec06..1f4790114 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,7 @@ build: preview: RELEASES_DIR = $(VPS_PREVIEW_PATH)/$(SAFE_BRANCH)/releases preview: TARGET = $(RELEASES_DIR)/$(TIMESTAMP) +preview: build preview: @echo "Preview site URL: $(PREVIEW_SITE_URL)" echo $(TARGET) @@ -72,6 +73,7 @@ ls -1dt */ \ ifeq ($(FORCE_DEPLOY), true) deploy: RELEASES_DIR = $(VPS_PROD_PATH)/releases deploy: TARGET = $(RELEASES_DIR)/$(TIMESTAMP) +deploy: build deploy: @echo "\n\n**** Deploying branch '$(BRANCH)' (safe: $(SAFE_BRANCH)) to $(TARGET)...\n\n" $(REMOTE_CMD) "mkdir -p $(TARGET)"