Skip to content

Commit

Permalink
test docker build with gh #3
Browse files Browse the repository at this point in the history
  • Loading branch information
the2pizza committed Oct 25, 2024
1 parent e434451 commit b427ef0
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 31 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release

on:
push:
tags: [ '*' ]

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Check GitHub Ref
run: echo "Current GitHub ref is: ${{ github.ref }}"

- name: Install latest rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
override: true
- name: Build
run: cargo build --all --release

- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
run: |
git tag ${{ env.version }}
git push origin ${{ env.version }}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
target/release/pony
README.md
config-example.toml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 changes: 2 additions & 31 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

env:
CARGO_TERM_COLOR: always
REGISTRY: "frknorg"
REGISTRY: frknorg
IMAGE: pony
DOCKER_TAG: latest

Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
username: ${{ env.REGISTRY }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
Expand All @@ -70,33 +70,4 @@ jobs:
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

release:
name: Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Install latest rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
override: true
- name: Build
run: cargo build --all --release

- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
run: |
git tag ${{ env.version }}
git push origin ${{ env.version }}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
target/release/pony
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit b427ef0

Please sign in to comment.