⚡ update: agentVersion #9
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
name: CI | |
on: push | |
env: | |
TMP_RELEASE: 1.31.1-2.0.0 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/[email protected] | |
- name: Install dependencies | |
run: sudo apt -y install rubygems && sudo gem install fpm && sudo apt install binutils && sudo apt-get install rpm -y | |
- name: Clear build directory | |
run: rm -rf ./build/ | |
- name: Debug | |
run: ls -al ./cmd/telegraf/ | |
- name: Build | |
run: NIGHTLY=vmonitor make package include_packages="linux_amd64.tar.gz amd64.deb" | |
- name: Debug | |
run: ls -al ./cmd/telegraf/ && ls -al ./build/dist/ | |
- name: Upload files to a GitHub release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ env.TMP_RELEASE }} | |
run: for file in ./build/dist/*; do gh release upload "${{ env.TMP_RELEASE }}" "$file" --repo="$GITHUB_REPOSITORY" --clobber; done | |
############## build and upload image | |
- name: Log in to the GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Log in to the vCR | |
uses: docker/login-action@v3 | |
with: | |
registry: vcr.vngcloud.vn | |
username: ${{ secrets.VCR_USER_PRO }} | |
password: ${{ secrets.VCR_PASSWORD_PRO }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
build-args: | | |
ARG_VERSION=${{ env.TMP_RELEASE }} | |
ARG_GITHUB_REPOSITORY=${{ github.repository }} | |
context: ./docker | |
push: true | |
tags: | | |
ghcr.io/${{ github.repository_owner }}/telegraf:${{ github.sha }} | |
vcr.vngcloud.vn/81-vmp-public/telegraf:${{ github.sha }} | |
# labels: ${{ steps.metadata.outputs.labels }} | |
- name: Build and push Docker image Alpine | |
uses: docker/build-push-action@v5 | |
with: | |
build-args: | | |
ARG_VERSION=${{ env.TMP_RELEASE }} | |
ARG_GITHUB_REPOSITORY=${{ github.repository }} | |
context: ./docker/alpine | |
push: true | |
tags: | | |
ghcr.io/${{ github.repository_owner }}/telegraf:${{ github.sha }}-alpine | |
vcr.vngcloud.vn/81-vmp-public/telegraf:${{ github.sha }}-alpine | |
# labels: ${{ steps.metadata.outputs.labels }} |