Skip to content

Commit 9a9de91

Browse files
committed
Make UP + GitHub Actions Buildx workflow
1 parent eae5f45 commit 9a9de91

File tree

3 files changed

+52
-4
lines changed

3 files changed

+52
-4
lines changed

.github/workflows/main.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: CI
4+
5+
# Controls when the workflow will run
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the master branch
8+
# push:
9+
# branches: [ master ]
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+
jobs:
16+
docker:
17+
runs-on: ubuntu-latest
18+
environment: deftworkEnvironment
19+
steps:
20+
-
21+
name: Checkout
22+
uses: actions/checkout@v2
23+
-
24+
name: Set up QEMU
25+
uses: docker/setup-qemu-action@v1
26+
-
27+
name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v1
29+
-
30+
name: Login to DockerHub
31+
uses: docker/login-action@v1
32+
with:
33+
username: ${{ secrets.DOCKERHUB_USERNAME }}
34+
password: ${{ secrets.DOCKERHUB_TOKEN }}
35+
-
36+
name: Login to GHCR
37+
if: github.event_name != 'pull_request'
38+
uses: docker/login-action@v1
39+
with:
40+
registry: ghcr.io
41+
username: ${{ github.repository_owner }}
42+
password: ${{ secrets.GITHUB_TOKEN }}
43+
-
44+
name: Make Buildx
45+
run: make buildx

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
SNAME ?= samba
22
RNAME ?= elswork/$(SNAME)
3+
ONAME ?= deftwork/$(SNAME)
34
VER ?= `cat VERSION`
45
BASENAME ?= alpine:latest
56
TARGET_PLATFORM ?= linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6
7+
# linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6
68
NO_CACHE ?=
79
# NO_CACHE ?= --no-cache
8-
# linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6
10+
#MODE ?= debug
11+
MODE ?= $(VER)
912

1013
# HELP
1114
# This will output the help for each task
@@ -44,7 +47,7 @@ debugx: ## Buildx in Debug mode
4447
buildx: ## Buildx the container
4548
docker buildx build $(NO_CACHE) \
4649
--platform ${TARGET_PLATFORM} \
47-
-t ghcr.io/$(RNAME):$(VER) -t ghcr.io/$(RNAME):latest \
50+
-t ghcr.io/$(ONAME):$(VER) -t ghcr.io/$(ONAME):latest \
4851
-t $(RNAME):$(VER) -t $(RNAME):latest --pull --push \
4952
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
5053
--build-arg VCS_REF=`git rev-parse --short HEAD` \
@@ -55,6 +58,6 @@ buildx: ## Buildx the container
5558

5659
start: ## Start samba
5760
docker run -d -p 139:139 -p 445:445 -e TZ=Europe/Madrid \
58-
-v /home/pirate/docker/makefile:/share/folder elswork/samba \
61+
-v /home/pirate/docker/makefile:/share/folder $(RNAME):$(MODE) \
5962
-u "1000:1000:pirate:pirate:put-any-password-here" \
6063
-s "SmbShare:/share/folder:rw:pirate"

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.2.7
1+
3.2.8

0 commit comments

Comments
 (0)