Skip to content

Commit

Permalink
Release artifacts (#22)
Browse files Browse the repository at this point in the history
push docker image only when a release is published
build camino-messenger-bot when a release is published and upload it as asset
  • Loading branch information
mo-c4t authored Aug 19, 2024
1 parent f812a86 commit 383e3db
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
name: Publish Docker image

on:
push:
branches: [c4t]
release:
types: [published]

jobs:
push_to_dockerhub:
name: Push Docker image to dockerhub
runs-on: ubuntu-latest

steps:
- name: Check out the repo
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
ref: ${{ github.event.release.tag }}

- name: Log in to Docker Hub
uses: docker/login-action@v3
Expand All @@ -26,4 +30,4 @@ jobs:
push: true
tags: |
c4tplatform/camino-messenger-bot:latest
c4tplatform/camino-messenger-bot:${{ github.sha }}
c4tplatform/camino-messenger-bot:${{ github.event.release.tag }}
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish Release Artifcats

on:
release:
types: [published]

permissions:
contents: write

jobs:
release:
name: Publish Artifcats
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
ref: ${{ github.event.release.tag }}

- uses: actions/setup-go@v5
with:
go-version: '1.20'

- name: Install libolm
run: sudo apt update && sudo apt-get install -y libolm-dev

- name: Build
run: ./scripts/build.sh

- name: upload release assets
run: |
cp ./build/bot ./camino-messenger-bot
tar -zcvf camino-messenger-bot-linux-amd64-${{ github.event.release.tag }}.tar.gz ./camino-messenger-bot
gh release upload ${{ github.event.release.tag }} camino-messenger-bot-linux-amd64-${{ github.event.release.tag }}.tar.gz
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
shell: bash

0 comments on commit 383e3db

Please sign in to comment.