Skip to content

Commit

Permalink
Add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubknejzlik committed May 2, 2023
1 parent b77244a commit e753904
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 8 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build and Deploy
on: [push]
jobs:
Build-And-Deploy:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: 1.15.6
- name: Build
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
make build tag push
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.5
FROM alpine:3.17

# https://serverfault.com/questions/772227/chmod-not-working-correctly-in-docker
RUN apk --update add docker
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile.docker-compose
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# building custom image due to https://github.com/xueshanf/docker-awscli/issues/6
FROM alpine:3.5
FROM alpine:3.17

# https://serverfault.com/questions/772227/chmod-not-working-correctly-in-docker
RUN apk add --update docker py-pip python-dev libffi-dev openssl-dev gcc libc-dev make ca-certificates
RUN pip install docker-compose
RUN apk update
RUN apk add docker docker-cli-compose

COPY bin/devops-alpine /usr/local/bin/devops
RUN chmod +x /usr/local/bin/devops
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.mysql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# building custom image due to https://github.com/xueshanf/docker-awscli/issues/6
FROM alpine:3.5
FROM alpine:3.17

# https://serverfault.com/questions/772227/chmod-not-working-correctly-in-docker
RUN apk --update add zip docker mysql-client
Expand Down
6 changes: 3 additions & 3 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ OWNER=novacloud
IMAGE_NAME=devops
QNAME=$(OWNER)/$(IMAGE_NAME)

GIT_TAG=$(QNAME):$(TRAVIS_COMMIT)
BUILD_TAG=$(QNAME):0.1.$(TRAVIS_BUILD_NUMBER)
GIT_TAG=$(QNAME):$(GITHUB_SHA)
BUILD_TAG=$(QNAME):0.1.$(GITHUB_RUN_NUMBER)
LATEST_TAG=$(QNAME):latest

lint:
Expand Down Expand Up @@ -32,7 +32,7 @@ tag:
docker tag $(GIT_TAG)-docker-compose $(LATEST_TAG)-docker-compose

login:
@docker login -u "$(DOCKER_USER)" -p "$(DOCKER_PASS)"
@docker login -u "$(DOCKER_USER)" -p "$(DOCKER_PASSWORD)"
push: login
# docker push $(GIT_TAG)
# docker push $(BUILD_TAG)
Expand Down

0 comments on commit e753904

Please sign in to comment.