forked from HaxeFoundation/haxelib
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (65 loc) · 2.45 KB
/
ci-dev.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: CI-dev
on:
push:
branches-ignore:
- master
pull_request:
workflow_dispatch:
env:
EARTHLY_USE_INLINE_CACHE: "true"
EARTHLY_SAVE_INLINE_CACHE: "true"
FORCE_COLOR: 1
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: earthly/actions-setup@v1
with:
version: "v0.6.30"
- name: Login to DockerHub
if: success() && github.repository_owner == 'HaxeFoundation' && github.event_name == 'push'
uses: docker/login-action@v1
with:
username: haxeci
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build images
run: earthly +ci-images --GIT_REF_NAME="${{ github.ref_name }}" --GIT_SHA="${{ github.sha }}"
- name: Run tests
run: earthly --allow-privileged +ci-tests
- name: Push images
run: earthly --push +ci-images --GIT_REF_NAME="${{ github.ref_name }}" --GIT_SHA="${{ github.sha }}"
if: github.repository_owner == 'HaxeFoundation' && github.event_name == 'push'
deploy-development:
if: success() && github.repository_owner == 'HaxeFoundation' && github.event_name == 'push' && github.ref_name == 'development'
needs: test
concurrency: deploy
runs-on: ubuntu-latest
container: haxe/haxelib_devcontainer_workspace:${{ github.sha }}
env:
AWS_DEFAULT_REGION: eu-west-1
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DIGITALOCEAN_ACCESS_TOKEN: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
SPACES_ACCESS_KEY_ID: ${{ secrets.SPACES_ACCESS_KEY_ID }}
SPACES_SECRET_ACCESS_KEY: ${{ secrets.SPACES_SECRET_ACCESS_KEY }}
TF_VAR_HAXELIB_DB_PASS: ${{ secrets.TF_VAR_HAXELIB_DB_PASS }}
TF_INPUT: 0
TF_IN_AUTOMATION: 1
steps:
- uses: actions/checkout@v2
- name: Verify image existence
run: docker manifest inspect haxe/lib.haxe.org:${{ github.sha }}
- name: Initialize Terraform
run: terraform init
working-directory: terraform
- name: Ensure no pending infra changes
run: terraform plan -refresh=false -detailed-exitcode
working-directory: terraform
- name: Set haxelib-server image
run: terraform apply -auto-approve -refresh=false
working-directory: terraform
env:
TF_VAR_HAXELIB_SERVER_IMAGE_DEVELOPMENT: haxe/lib.haxe.org:${{ github.sha }}