Skip to content

Commit

Permalink
replace circleci to use github actions and add internal job for deplo…
Browse files Browse the repository at this point in the history
…yment (mattermost#5378)
  • Loading branch information
Carlos Tadeu Panato Junior authored Jan 21, 2022
1 parent ea2aff0 commit 7769536
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 86 deletions.
85 changes: 0 additions & 85 deletions .circleci/config.yml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build

on:
push:
branches:
- master
- staging
pull_request:

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: '3.7'

- name: Run Python deps
run: make python-deps

- name: Run build
run: make html

- uses: actions/upload-artifact@v2
with:
name: docs
path: build/html

- uses: actions/upload-artifact@v2
with:
name: doc-logs
path: build/*.log
48 changes: 48 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This run in the mattermost gitlab internal instace
variables:
AWS_DEFAULT_REGION: "us-east-1"

IMAGE_BUILD: cimg/python:3.7
IMAGE_AWS_CI: $CI_REGISTRY/images/aws-ci:2.1.1-1

stages:
- build
- deploy

build-package:
stage: build
image: $IMAGE_BUILD
before_script:
- make python-deps
script:
- make html
artifacts:
paths:
- ./build/html
expire_in: 2 hours
only:
refs:
- master
- staging

s3-release-prod:
image: $IMAGE_AWS_CI
stage: deploy
script:
- aws s3 cp build/html s3://docs.mattermost.com/ --recursive --cache-control no-cache --acl public-read
needs:
- build-package
only:
refs:
- master

s3-release-staging:
image: $IMAGE_AWS_CI
stage: deploy
script:
- aws s3 cp build/html s3://docs-stagging.mattermost.com/ --recursive --cache-control no-cache --acl public-read
needs:
- build-package
only:
refs:
- staging
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ SPHINXAUTOBUILD ?= pipenv run sphinx-autobuild
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile livehtml
.PHONY: help Makefile livehtml python-deps

python-deps:
pip install pipenv
pipenv install --dev

# Run `make livehtml` to start sphinx-autobuild
livehtml:
Expand Down

0 comments on commit 7769536

Please sign in to comment.