Skip to content

Commit 82300b8

Browse files
committed
chore: add basic workflows for manually running Terraform and Ansible from GitHub Actions
Part of #1631 [skip ci]
1 parent 4e6e103 commit 82300b8

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Provision a server by Ansible
2+
3+
on:
4+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_dispatch
5+
workflow_dispatch:
6+
7+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
8+
permissions:
9+
contents: read # for "git clone"
10+
11+
defaults:
12+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#defaultsrun
13+
run:
14+
# Enable fail-fast behavior using set -eo pipefail
15+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
16+
shell: bash
17+
18+
jobs:
19+
setup-server:
20+
name: Provision a server
21+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on
22+
runs-on: ubuntu-20.04
23+
steps:
24+
25+
- name: Clone source code
26+
uses: actions/[email protected] # https://github.com/actions/checkout
27+
with:
28+
# Whether to configure the token or SSH key with the local git config. Default: true
29+
persist-credentials: false
30+
31+
- name: Install ansible
32+
# The command pip3 install --user ansible==2.10.17 doesn't work as we have an old version
33+
# See https://docs.ansible.com/ansible/2.10/installation_guide/intro_installation.html#installing-devel-from-github-with-pip
34+
run: python3 -m pip install --user https://github.com/ansible/ansible/archive/refs/tags/v2.10.17.tar.gz
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Setup a server by Terraform
2+
3+
on:
4+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_dispatch
5+
workflow_dispatch:
6+
7+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
8+
permissions:
9+
contents: read # for "git clone"
10+
11+
defaults:
12+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#defaultsrun
13+
run:
14+
# Enable fail-fast behavior using set -eo pipefail
15+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
16+
shell: bash
17+
18+
jobs:
19+
setup-server:
20+
name: Setup a server
21+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on
22+
runs-on: ubuntu-20.04
23+
steps:
24+
25+
- name: Clone source code
26+
uses: actions/[email protected] # https://github.com/actions/checkout
27+
with:
28+
# Whether to configure the token or SSH key with the local git config. Default: true
29+
persist-credentials: false
30+
31+
- name: Install terraform
32+
working-directory: infra/terraform
33+
run: tfenv install

0 commit comments

Comments
 (0)