Skip to content

Commit

Permalink
Merge pull request #5 from makeopensource/ci/cd
Browse files Browse the repository at this point in the history
actions are fully complete
  • Loading branch information
RA341 authored Sep 26, 2024
2 parents b0be1b4 + b83cfa0 commit bf0ec7f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 49 deletions.
26 changes: 10 additions & 16 deletions .github/workflows/beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,24 @@ jobs:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
packages: write # to be able to publish docker images
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: 'Get tag'
id: tagName
uses: "WyriHaximus/github-action-get-previous-tag@v1"

## docker image build
# docker image build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ github.repository }}:beta
- name: Login to GHCR registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: build image
run: docker build . -t ghcr.io/${{ github.repository }}:beta

- name: push
run: docker push ghcr.io/${{ github.repository }}:beta

# if the binary needs to built directly
# - name: Set up Go
Expand Down
47 changes: 14 additions & 33 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Release
on:
push:
branches:
- release # or main
- release

jobs:
tag-release:
Expand Down Expand Up @@ -39,6 +39,8 @@ jobs:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
packages: write # to be able to publish docker images

steps:
- uses: actions/checkout@v3
with:
Expand All @@ -48,42 +50,21 @@ jobs:
id: tagName
uses: "WyriHaximus/github-action-get-previous-tag@v1"

## docker image build

# docker image build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# - name: Login to Docker Hub
# uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to GHCR registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ github.repository }}:${{ steps.tagName.outputs.tag }}
- name: build version tagged image
run: docker build . -t ghcr.io/${{ github.repository }}:${{ steps.tagName.outputs.tag }}

- name: push tagged
run: docker push ghcr.io/${{ github.repository }}:${{ steps.tagName.outputs.tag }}

- name: build latest tagged image
run: docker build . -t ghcr.io/${{ github.repository }}:latest

# if the binary needs to built directly
# - name: Set up Go
# uses: actions/setup-go@v4
# with:
# go-version: '1.22'
# - name: Install dependencies
# run: go mod tidy
#
# - name: Build
# run: go build -ldflags "-w -s" -o multipacman_linux_${{ steps.tagName.outputs.tag }}
#
# - name: Upload Release Asset
# uses: softprops/action-gh-release@v2
# with:
# files: |
# multipacman_linux_${{ steps.tagName.outputs.tag }}
# tag_name: ${{ steps.tagName.outputs.tag }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: push latest
run: docker push ghcr.io/${{ github.repository }}:latest

0 comments on commit bf0ec7f

Please sign in to comment.