Deploy #63
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow to help you get started with Actions | |
name: Deploy | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
- cron: '0 0 */10 * *' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
- name: Setup Go environment | |
uses: actions/setup-go@v2 | |
- name: Retrieve version | |
run: | | |
echo "::set-output name=tag::$(curl --silent "https://api.github.com/repos/grafana/loki/releases/latest" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/')" | |
id: version | |
- name: Git Clone Action | |
# You may pin to the exact commit or the version. | |
# uses: sudosubin/git-clone-action@8a93ce24d47782e30077508cccacf8a05a891bae | |
uses: sudosubin/[email protected] | |
with: | |
# Repository owner and name. Ex: sudosubin/git-clone-action | |
repository: grafana/loki | |
ref: ${{ steps.version.outputs.tag }} | |
path: loki | |
- name: Install Utils | |
run: sudo apt-get install -y wget unzip | |
- name: Download loki | |
run: wget https://github.com/grafana/loki/releases/download/${{ steps.version.outputs.tag }}/loki-linux-amd64.zip | |
- name: Download promtail | |
run: wget https://github.com/grafana/loki/releases/download/${{ steps.version.outputs.tag }}/promtail-linux-amd64.zip | |
- name: Unzip loki Binaries | |
run: unzip loki-linux-amd64.zip | |
- name: Unzip promtail Binaries | |
run: unzip promtail-linux-amd64.zip | |
# Build Loki DEB Package | |
- name: Build loki Linux DEB Packages | |
uses: kentik/[email protected] | |
with: | |
name: loki | |
version: ${{ steps.version.outputs.tag }} | |
arch: x86_64 | |
format: rpm | |
package: loki-package.yml | |
# Build Loki RPM Package | |
- name: Build loki Linux PKG Packages | |
uses: kentik/[email protected] | |
with: | |
name: loki | |
version: ${{ steps.version.outputs.tag }} | |
arch: x86_64 | |
format: deb | |
package: loki-package.yml | |
# Build promtail DEB Package | |
- name: Build promtail Linux DEB Packages | |
uses: kentik/[email protected] | |
with: | |
name: promtail | |
version: ${{ steps.version.outputs.tag }} | |
arch: x86_64 | |
format: rpm | |
package: promtail-package.yml | |
# Build promtail RPM Package | |
- name: Build promtail Linux PKG Packages | |
uses: kentik/[email protected] | |
with: | |
name: promtail | |
version: ${{ steps.version.outputs.tag }} | |
arch: x86_64 | |
format: deb | |
package: promtail-package.yml | |
- name: Upload Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ steps.version.outputs.tag }} | |
files: | | |
*.rpm | |
*.deb |