Skip to content

Commit

Permalink
github-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
gkostin1966 committed Jun 9, 2021
1 parent 9746c23 commit 033f689
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/bundle-exec-rspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: bundle-exec-rspec

on: workflow_dispatch

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
# - name: Create .env file
# run: cat .env-example .env-dev-values > .env
# - name: Load .env file
# uses: xom9ikk/dotenv@v1.0.2
- name: Set up Ruby 2.6.6
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6.6
bundler-cache: true
- name: Run tests
run: bundle exec rubocop
32 changes: 32 additions & 0 deletions .github/workflows/deploy-branch-to-testing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: deploy-branch-to-testing

on: workflow_dispatch

jobs:
deploy:
runs-on: ubuntu-latest
environment: fulcrum-testing
steps:
- name: GITHUB_SHA
run: echo "$GITHUB_SHA"
- name: GITHUB_REF
run: echo "$GITHUB_REF"
- name: SECRETS
env:
SECRETS: ${{ toJson(secrets) }}
run: echo "$SECRETS"
- name: Setup Kubectl
uses: azure/setup-kubectl@v1
- name: Authenticate with kubernetes
run: |
mkdir -p ${HOME}/.kube/certs/cluster
echo ${{ secrets.CA_CRT_BASE64 }} | base64 -d > ${HOME}/.kube/certs/cluster/k8s-ca.crt
kubectl config set-cluster cluster --certificate-authority=${HOME}/.kube/certs/cluster/k8s-ca.crt --server=`echo ${{ secrets.SERVER_URL_BASE64 }} | base64 -d`
kubectl config set-credentials default --token=`echo ${{ secrets.TOKEN_BASE64 }} | base64 -d`
kubectl config set-context default --cluster=cluster --user=default --namespace=`echo ${{ secrets.NAMESPACE_BASE64 }} | base64 -d`
kubectl config use-context default
- name: Deploy
run: |
kubectl config view
kubectl config current-context
# kubectl set image deployment web web=docker.pkg.github.com/mlibrary/patron_account/patron_account:${{ steps.tag_check.outputs.tag }}
36 changes: 36 additions & 0 deletions .github/workflows/echo-env-context-to-json.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: echo-env-context-to-json

on: workflow_dispatch

jobs:
echo:
runs-on: ubuntu-latest
steps:
- name: GITHUB_SHA
run: echo "GITHUB_SHA $GITHUB_SHA"
- name: GITHUB_REF
run: echo "GITHUB_REF $GITHUB_REF"
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Dump job context
env:
JOB_CONTEXT: ${{ toJson(job) }}
run: echo "$JOB_CONTEXT"
- name: Dump steps context
env:
STEPS_CONTEXT: ${{ toJson(steps) }}
run: echo "$STEPS_CONTEXT"
- name: Dump runner context
env:
RUNNER_CONTEXT: ${{ toJson(runner) }}
run: echo "$RUNNER_CONTEXT"
- name: Dump strategy context
env:
STRATEGY_CONTEXT: ${{ toJson(strategy) }}
run: echo "$STRATEGY_CONTEXT"
- name: Dump matrix context
env:
MATRIX_CONTEXT: ${{ toJson(matrix) }}
run: echo "$MATRIX_CONTEXT"
21 changes: 21 additions & 0 deletions .github/workflows/package-branch-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: package-branch-image

on: workflow_dispatch

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Checkout
- uses: craftech-io/package-action@v3.1.0
name: Package
id: url-GPR
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
image_name: fulcimen
tags: |
latest
${{ github.sha }}
- name: imageURL
run: echo ${{ steps.url-GPR.outputs.imageURL }}
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ GEM
nio4r (2.5.1)
nokogiri (1.11.7-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.11.7-x86_64-linux)
racc (~> 1.4)
parallel (1.20.1)
parser (3.0.1.1)
ast (~> 2.4.1)
Expand Down Expand Up @@ -310,6 +312,7 @@ GEM

PLATFORMS
x86_64-darwin-18
x86_64-linux

DEPENDENCIES
bootsnap (~> 1.4.6)
Expand Down

0 comments on commit 033f689

Please sign in to comment.