Skip to content

Commit

Permalink
build docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
karstenkoehler committed Feb 5, 2025
1 parent 09cd201 commit 606b72b
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 71 deletions.
116 changes: 47 additions & 69 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,99 +31,77 @@ jobs:
name: build
path: build

deploy-test:
build-push-docker:
needs: build
if: github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
environment:
name: techradar-test-aoe
url: http://techradar-test-aoe.s3-website.eu-central-1.amazonaws.com/techradar/
permissions:
id-token: write
contents: read
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@master
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
aws-region: eu-central-1
role-to-assume: arn:aws:iam::511165248623:role/github_techradar
role-session-name: GitHubActions
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: build
path: build
- run: 'aws s3 sync --delete build/ s3://techradar-test-aoe/techradar/'

deploy:
needs: build
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment:
name: techradar
url: https://www.aoe.com/techradar/
permissions:
id-token: write
contents: read
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@master
with:
aws-region: eu-central-1
role-to-assume: arn:aws:iam::511165248623:role/github_techradar
role-session-name: GitHubActions
- name: Download Artifact
uses: actions/download-artifact@v4
- name: Build and push
uses: docker/build-push-action@v6
with:
name: build
path: build
- run: 'aws s3 sync --delete build/ s3://techradar-prod-aoe/techradar/'
context: .
push: true
tags: ghcr.io/aoepeople/techradar:latest

# deploy:
# runs-on: ubuntu-20.04
# if: github.ref == 'refs/heads/main'
# deploy-test:
# needs: build
# if: github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
# runs-on: ubuntu-latest
# environment:
# name: techradar
# url: https://www.aoe.com/techradar/index.html
# name: techradar-test-aoe
# url: http://techradar-test-aoe.s3-website.eu-central-1.amazonaws.com/techradar/
# permissions:
# id-token: write
# contents: read
# steps:
# - name: Configure AWS Credentials
# uses: aws-actions/configure-aws-credentials@master
# with:
# aws-region: eu-central-1
# role-to-assume: arn:aws:iam::511165248623:role/github_techradar
# role-session-name: GitHubActions
# - name: Download Artifact
# uses: actions/download-artifact@v3
# uses: actions/download-artifact@v4
# with:
# name: build
# path: build
# - uses: jakejarvis/s3-sync-action@master
# with:
# args: --acl public-read
# env:
# AWS_S3_BUCKET: "techradar.aoe.com"
# AWS_ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.ACCESS_SECRET }}
# AWS_REGION: "eu-central-1"
# SOURCE_DIR: "build"
# DEST_DIR: "techradar"
# - run: 'aws s3 sync --delete build/ s3://techradar-test-aoe/techradar/'
#
# deploy-dev:
# runs-on: ubuntu-20.04
# if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
# deploy:
# needs: build
# if: github.ref == 'refs/heads/main'
# runs-on: ubuntu-latest
# environment:
# name: techradar-next
# url: http://techradar-next.aoe.com.s3.eu-central-1.amazonaws.com/techradar/index.html
# name: techradar
# url: https://www.aoe.com/techradar/
# permissions:
# id-token: write
# contents: read
# steps:
# - run: echo "WARNING! THIS DEPLOYS A STAGING ENV, RERUN THIS JOB TO GET YOUR CHANGES DEPLOYED TO STAGING"
# - name: Configure AWS Credentials
# uses: aws-actions/configure-aws-credentials@master
# with:
# aws-region: eu-central-1
# role-to-assume: arn:aws:iam::511165248623:role/github_techradar
# role-session-name: GitHubActions
# - name: Download Artifact
# uses: actions/download-artifact@v3
# uses: actions/download-artifact@v4
# with:
# name: build
# path: build
# - uses: jakejarvis/s3-sync-action@master
# with:
# args: --acl public-read
# env:
# AWS_S3_BUCKET: "techradar-next.aoe.com"
# AWS_ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.ACCESS_SECRET }}
# AWS_REGION: "eu-central-1"
# SOURCE_DIR: "build"
# DEST_DIR: "techradar"
# - run: 'aws s3 sync --delete build/ s3://techradar-prod-aoe/techradar/'
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM nginx
COPY build /usr/share/nginx/html
4 changes: 2 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"basePath": "/techradar",
"baseUrl": "https://www.aoe.com/techradar",
"basePath": "/",
"baseUrl": "https://techradar.aoe.com",
"editUrl": "https://github.dev/AOEpeople/techradar/blob/main/radar/{release}/{id}.md",
"logoFile": "logo.svg",
"jsFile": "",
Expand Down

0 comments on commit 606b72b

Please sign in to comment.