github-pages-deploy-action/.github/workflows/integration.yml
2022-01-11 23:22:19 -05:00

273 lines
7.4 KiB
YAML

name: integration-tests
on:
workflow_dispatch:
inputs:
branch:
description: 'Specifies the branch which the integration tests should run on.'
required: true
default: 'releases/v4'
schedule:
- cron: 30 15 * * 0-6
push:
tags-ignore:
- '*.*'
branches:
- releases/v4
jobs:
# Deploys cross repo with an access token.
integration-cross-repo-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.4.0
- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
git-config-name: Montezuma
git-config-email: montezuma@jamesiv.es
repository-name: MontezumaIves/lab
token: ${{ secrets.ACCESS_TOKEN }}
branch: gh-pages
folder: integration
single-commit: true
clean: true
silent: true
# Deploys using checkout@v1 with an ACCESS_TOKEN.
integration-checkout-v1:
needs: integration-cross-repo-push
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.ACCESS_TOKEN }}
branch: gh-pages
folder: integration
target-folder: cat/montezuma
git-config-name: Montezuma
git-config-email: montezuma@jamesiv.es
silent: true
- name: Cleanup Generated Branch
uses: dawidd6/action-delete-branch@v3.1.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branches: gh-pages
# Deploys using checkout@v2 with a GITHUB_TOKEN.
integration-checkout-v2:
needs: integration-checkout-v1
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.4.0
with:
persist-credentials: false
- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: integration
target-folder: cat/montezuma2
silent: true
- name: Cleanup Generated Branch
uses: dawidd6/action-delete-branch@v3.1.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branches: gh-pages
# Deploys using a container that requires you to install rsync.
integration-container:
needs: integration-checkout-v2
runs-on: ubuntu-latest
container:
image: ruby:2.6
env:
LANG: C.UTF-8
steps:
- name: Checkout
uses: actions/checkout@v2.4.0
with:
persist-credentials: false
- name: Install rsync
run: |
apt-get update && apt-get install -y rsync
- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: integration
target-folder: cat/montezuma2
silent: true
- name: Cleanup Generated Branch
uses: dawidd6/action-delete-branch@v3.1.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branches: gh-pages
# Deploys using an SSH key.
integration-ssh:
needs: integration-container
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.4.0
with:
persist-credentials: false
- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
branch: gh-pages
folder: integration
target-folder: cat/montezuma3
silent: true
- name: Cleanup Generated Branch
uses: dawidd6/action-delete-branch@v3.1.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branches: gh-pages
# Deploys using an SSH key.
integration-ssh-third-party-client:
needs: integration-ssh
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.4.0
with:
persist-credentials: false
- name: Install SSH Client
uses: webfactory/ssh-agent@v0.5.4
with:
ssh-private-key: ${{ secrets.DEPLOY_KEY }}
- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
ssh-key: true
branch: gh-pages
folder: integration
target-folder: cat/montezuma4
silent: true
- name: Cleanup Generated Branch
uses: dawidd6/action-delete-branch@v3.1.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branches: gh-pages
# Deploys using a custom env. (Includes subsequent commit)
integration-env:
needs: integration-ssh-third-party-client
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v2.5.1
with:
node-version: 'v14.18.1'
- name: Checkout
uses: actions/checkout@v2.4.0
with:
persist-credentials: false
- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
branch: gh-pages
folder: integration
target-folder: cat/montezuma4
silent: true
- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
branch: gh-pages
folder: integration
target-folder: cat/subsequent
silent: true
- name: Cleanup Generated Branch
uses: dawidd6/action-delete-branch@v3.1.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branches: gh-pages
# Deploys using the CLEAN option.
integration-clean:
needs:
[
integration-checkout-v1,
integration-checkout-v2,
integration-container,
integration-ssh,
integration-ssh-third-party-client,
integration-env,
]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.4.0
with:
persist-credentials: false
- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.ACCESS_TOKEN }}
branch: gh-pages
folder: integration
clean: true
silent: true
# Deploys to a branch that doesn't exist with SINGLE_COMMIT. (Includes subsequent commit)
integration-branch-creation:
needs: integration-clean
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.4.0
with:
persist-credentials: false
- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.ACCESS_TOKEN }}
branch: integration-test-delete-prod
folder: integration
single-commit: true
silent: true
- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.ACCESS_TOKEN }}
branch: integration-test-delete-prod
folder: integration
single-commit: true
target-folder: jives
silent: true
- name: Cleanup Generated Branch
uses: dawidd6/action-delete-branch@v3.1.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branches: integration-test-delete-prod