Skip to content

update next version #23

update next version

update next version #23

Workflow file for this run

name: ci
on:
push:
branches:
- "main"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v3
- name: get version
id: get-version
uses: beaconbrigade/[email protected]
with:
path: .
- name: Print the version
run: echo "The version was ${{ steps.get-version.outputs.version }}"
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.PROD_DOCKERHUB_USERNAME }}
password: ${{ secrets.PROD_DOCKERHUB_TOKEN }}
- name: Make envfile
uses: SpicyPizza/[email protected]
with:
envkey_SLACK_APP_TOKEN: ${{secrets.PROD_SLACK_APP_TOKEN}}
envkey_SLACK_CLIENT_ID: ${{secrets.PROD_SLACK_CLIENT_ID}}
envkey_SLACK_CLIENT_SECRET: ${{secrets.PROD_SLACK_CLIENT_SECRET}}
envkey_SLACK_CODE: ${{secrets.PROD_SLACK_CODE}}
envkey_SLACK_SIGNING_SECRET: ${{secrets.PROD_SLACK_SIGNING_SECRET}}
envkey_DATABASE_URL: ${{secrets.PROD_DATABASE_URL}}
envkey_NEXTAUTH_SECRET: ${{secrets.PROD_NEXTAUTH_SECRET}}
envkey_PROTOCOL: ${{secrets.PROD_PROTOCOL}}
envkey_COMMUNICATION_TOKEN: ${{secrets.PROD_COMMUNICATION_TOKEN}}
envkey_BOT_URI: ${{secrets.PROD_BOT_URI}}
envkey_WEB_URI: ${{secrets.PROD_WEB_URI}}
file_name: .env.production
directory: ./
fail_on_empty: true
sort_keys: true
- name: Build & Publish docker image
run: |
docker build . -f ./dockerfile --platform linux/amd64 -t ${{ secrets.PROD_DOCKERHUB_USERNAME }}/ssb:latest -t ${{ secrets.PROD_DOCKERHUB_USERNAME }}/ssb:${{ steps.get-version.outputs.version }} -t ${{ secrets.PROD_DOCKERHUB_USERNAME }}/ssb:${{ github.sha }}
docker push ${{ secrets.PROD_DOCKERHUB_USERNAME }}/ssb:latest
docker push ${{ secrets.PROD_DOCKERHUB_USERNAME }}/ssb:${{ steps.get-version.outputs.version }}
docker push ${{ secrets.PROD_DOCKERHUB_USERNAME }}/ssb:${{ github.sha }}
- name: applying new image on prod
uses: appleboy/[email protected]
with:
host: ${{ secrets.PROD_HOST }}
username: ${{ secrets.PROD_USERNAME }}
key: ${{ secrets.PROD_KEY }}
script_stop: true
script: |
cd simple-standup-bot
git pull
DOCKERHUB_USERNAME=${{ secrets.PROD_DOCKERHUB_USERNAME }} bash -c ./start.sh