Skip to content

v0.1.27

v0.1.27 #28

Workflow file for this run

name: Publish Docker image
on:
release:
types: [published]
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
name: id_rsa
known_hosts: ${{ secrets.SSH_HOST }}
- name: Set up Git
run: git config --global url.ssh://git@github.com/.insteadOf https://github.com/
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
push: true
tags: openfort/shield:${{ github.event.release.tag_name }}
- name: Set up yq
uses: chrisdickinson/setup-yq@latest
with:
version: 4.30.8
- name: Clone Infra Repository
run: |
git clone git@github.com:openfort-xyz/kube.git
- name: Update version
uses: mikefarah/yq@master
with:
cmd: yq -i '.shield.tag = "${{ github.event.release.tag_name }}"' kube/values.yaml
- name: Update Infra Repository
run: |
cd kube
git config --global user.email "cd@openfort.xyz"
git config --global user.name "CD"
git add .
git commit -m "Update Shield version to ${{ github.event.release.tag_name }}"
git push