diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml index 66671fa51..a1a92cc44 100644 --- a/.github/workflows/deploy-prod.yml +++ b/.github/workflows/deploy-prod.yml @@ -43,8 +43,8 @@ jobs: NODE_ENV: production - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - with: - cname: blog.system76.com - github_token: ${{ secrets.RELEASE_TOKEN }} - publish_dir: ./dist + run: aws s3 sync ./dist s3://${{ secrets.PRODUCTION_AWS_S3_BUCKET }}/blog --delete + env: + AWS_ACCESS_KEY_ID: ${{ secrets.PRODUCTION_AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.PRODUCTION_AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: ${{ secrets.PRODUCTION_AWS_REGION }} diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index 59be52449..64c894af9 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -52,13 +52,9 @@ jobs: path: 'deploy' token: ${{ secrets.RELEASE_TOKEN }} - - name: Push build to blog-staging repo - run: | - cp -r dist/* deploy - cd deploy - touch .nojekyll - echo "blog.genesis76.com" > CNAME - echo -e "User-agent: *\nDisallow: /" > robots.txt - git add . - git commit -m 'deploy: ${GITHUB_SHA::8}' - git push + - name: Deploy + run: aws s3 sync ./dist s3://${{ secrets.STAGING_AWS_S3_BUCKET }}/blog --delete + env: + AWS_ACCESS_KEY_ID: ${{ secrets.STAGING_AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.STAGING_AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: ${{ secrets.STAGING_AWS_REGION }} diff --git a/nuxt.config.js b/nuxt.config.js index 5463a4a9b..fb2238ac4 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -5,12 +5,16 @@ const prismicApiUrl = apiEndpoint const HOST = process.env.NODE_ENV === 'development' ? 'http://localhost:3000' : process.env.NODE_ENV === 'staging' - ? 'https://blog.genesis76.com' - : 'https://blog.system76.com' + ? 'https://genesis76.com/blog' + : 'https://system76.com/blog' export default { target: 'static', + router: { + base: '/blog/' + }, + components: [ '~/components', { path: '~/slices', extensions: ['vue'] }