Skip to content

Commit

Permalink
Merge pull request #221 from MarcHagen/basic-automation
Browse files Browse the repository at this point in the history
fix: Update and add basic repo automation
  • Loading branch information
vtsykun authored Feb 5, 2024
2 parents 57ff37e + 23890f6 commit 6e5411e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 25 deletions.
6 changes: 6 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# People marked here will be automatically requested for a review
# when the code that they own is touched.
# https://github.com/blog/2392-introducing-code-owners
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

* @vtsykun
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
labels: []
39 changes: 14 additions & 25 deletions .github/workflows/docker_hub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,57 +15,46 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
with:
platforms: arm64

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache-qemu
key: ${{ runner.os }}-buildx-cache-qemu
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Calculate docker image tag
id: set-tag
uses: docker/metadata-action@master
id: docker_meta
uses: docker/metadata-action@v5
with:
images: packeton/packeton
flavor: |
latest=false
tags: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
type=pep440,pattern={{major}}.{{minor}}
type=pep440,pattern={{ version }}
type=pep440,pattern={{ major }}.{{ minor }}
- name: Build and push
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
# file: "Dockerfile"
file: Dockerfile
push: true
tags: "${{ steps.set-tag.outputs.tags }}"
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=local,src=/tmp/.buildx-cache-qemu
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
cache-from: type=gha,scope=${{ github.workflow }}
cache-to: type=gha,scope=${{ github.workflow }},mode=max

# Issue https://github.com/rust-lang/cargo/issues/10583
build-args: |
CARGO_NET_GIT_FETCH_WITH_CLI=true
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache-qemu
mv /tmp/.buildx-cache-new /tmp/.buildx-cache-qemu

0 comments on commit 6e5411e

Please sign in to comment.